File tree 1 file changed +4
-4
lines changed
client/rest/src/test/java/org/elasticsearch/client
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 42
42
import static org .elasticsearch .client .RestClientTestUtil .getAllStatusCodes ;
43
43
import static org .elasticsearch .client .RestClientTestUtil .randomErrorNoRetryStatusCode ;
44
44
import static org .elasticsearch .client .RestClientTestUtil .randomOkStatusCode ;
45
- import static org .hamcrest .Matchers .startsWith ;
46
45
import static org .junit .Assert .assertEquals ;
47
- import static org .junit .Assert .assertThat ;
48
46
import static org .junit .Assert .assertTrue ;
49
47
import static org .junit .Assert .fail ;
50
48
@@ -216,8 +214,10 @@ public void testNodeSelector() throws IOException {
216
214
restClient .performRequest (request );
217
215
fail ("expected to fail to connect" );
218
216
} catch (ConnectException e ) {
219
- // This is different in windows and linux but this matches both.
220
- assertThat (e .getMessage (), startsWith ("Connection refused" ));
217
+ // Windows isn't consistent here. Sometimes the message is even null!
218
+ if (false == System .getProperty ("os.name" ).startsWith ("Windows" )) {
219
+ assertEquals ("Connection refused" , e .getMessage ());
220
+ }
221
221
}
222
222
} else {
223
223
Response response = restClient .performRequest (request );
You can’t perform that action at this time.
0 commit comments