77import uk .org .webcompere .systemstubs .properties .SystemProperties ;
88
99import static org .hamcrest .MatcherAssert .assertThat ;
10- import static org .hamcrest .Matchers .is ;
10+ import static org .hamcrest .Matchers .* ;
1111import static org .junit .jupiter .api .Assertions .assertThrows ;
1212
1313/**
@@ -27,10 +27,10 @@ void create_throesExceptionIfUserNotSet() {
2727 System .setProperty (ProxyConfigNames .HTTP_PROXY_PORT .getLiterat (), "4242" );
2828
2929 final var thrown = assertThrows (
30- ProxyConfigFactory . MissingProxyConfigValue .class ,
30+ MissingProxyConfigValue .class ,
3131 sut ::create );
3232
33- assertThat (thrown .getMessage (), is ( "Expected System property 'http.proxyUser' not set! " ));
33+ assertThat (thrown .getMessage (), containsString ( " 'http.proxyUser'" ));
3434 }
3535
3636 @ Test
@@ -41,10 +41,10 @@ void create_throesExceptionIfPasswordNotSet() {
4141 System .setProperty (ProxyConfigNames .HTTP_PROXY_PORT .getLiterat (), "4242" );
4242
4343 final var thrown = assertThrows (
44- ProxyConfigFactory . MissingProxyConfigValue .class ,
44+ MissingProxyConfigValue .class ,
4545 sut ::create );
4646
47- assertThat (thrown .getMessage (), is ( "Expected System property 'http.proxyPassword' not set! " ));
47+ assertThat (thrown .getMessage (), containsString ( " 'http.proxyPassword'" ));
4848 }
4949
5050 @ Test
@@ -55,10 +55,10 @@ void create_throesExceptionIfHostNotSet() {
5555 System .setProperty (ProxyConfigNames .HTTP_PROXY_PORT .getLiterat (), "4242" );
5656
5757 final var thrown = assertThrows (
58- ProxyConfigFactory . MissingProxyConfigValue .class ,
58+ MissingProxyConfigValue .class ,
5959 sut ::create );
6060
61- assertThat (thrown .getMessage (), is ( "Expected System property 'http.proxyHost' not set! " ));
61+ assertThat (thrown .getMessage (), containsString ( " 'http.proxyHost'" ));
6262 }
6363
6464 @ Test
@@ -69,10 +69,10 @@ void create_throesExceptionIfPortNotSet() {
6969 System .clearProperty (ProxyConfigNames .HTTP_PROXY_PORT .getLiterat ());
7070
7171 final var thrown = assertThrows (
72- ProxyConfigFactory . MissingProxyConfigValue .class ,
72+ MissingProxyConfigValue .class ,
7373 sut ::create );
7474
75- assertThat (thrown .getMessage (), is ( "Expected System property 'http.proxyPort' not set! " ));
75+ assertThat (thrown .getMessage (), containsString ( " 'http.proxyPort'" ));
7676 }
7777
7878 @ Test
0 commit comments