File tree 1 file changed +4
-1
lines changed
client/rest/src/test/java/org/elasticsearch/client
1 file changed +4
-1
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 ;
45
46
import static org .junit .Assert .assertEquals ;
47
+ import static org .junit .Assert .assertThat ;
46
48
import static org .junit .Assert .assertTrue ;
47
49
import static org .junit .Assert .fail ;
48
50
@@ -214,7 +216,8 @@ public void testNodeSelector() throws IOException {
214
216
restClient .performRequest (request );
215
217
fail ("expected to fail to connect" );
216
218
} 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" ));
218
221
}
219
222
} else {
220
223
Response response = restClient .performRequest (request );
You can’t perform that action at this time.
0 commit comments