File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
client/rest/src/test/java/org/elasticsearch/client Expand file tree Collapse file tree 1 file changed +4
-1
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 ;
4546import static org .junit .Assert .assertEquals ;
47+ import static org .junit .Assert .assertThat ;
4648import static org .junit .Assert .assertTrue ;
4749import static org .junit .Assert .fail ;
4850
@@ -214,7 +216,8 @@ public void testNodeSelector() throws IOException {
214216 restClient .performRequest (request );
215217 fail ("expected to fail to connect" );
216218 } catch (ConnectException e ) {
217- assertEquals ("Connection refused" , e .getMessage ());
219+ // This is different in windows and linux but this matches both.
220+ assertThat (e .getMessage (), startsWith ("Connection refused" ));
218221 }
219222 } else {
220223 Response response = restClient .performRequest (request );
You can’t perform that action at this time.
0 commit comments