File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
client/rest/src/test/java/org/elasticsearch/client Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4242import static org .elasticsearch .client .RestClientTestUtil .getAllStatusCodes ;
4343import static org .elasticsearch .client .RestClientTestUtil .randomErrorNoRetryStatusCode ;
4444import static org .elasticsearch .client .RestClientTestUtil .randomOkStatusCode ;
45- import static org .hamcrest .Matchers .startsWith ;
4645import static org .junit .Assert .assertEquals ;
47- import static org .junit .Assert .assertThat ;
4846import static org .junit .Assert .assertTrue ;
4947import static org .junit .Assert .fail ;
5048
@@ -216,8 +214,10 @@ public void testNodeSelector() throws IOException {
216214 restClient .performRequest (request );
217215 fail ("expected to fail to connect" );
218216 } 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+ }
221221 }
222222 } else {
223223 Response response = restClient .performRequest (request );
You can’t perform that action at this time.
0 commit comments