Skip to content

Commit

Permalink
LLClient: Fix assertion on windows
Browse files Browse the repository at this point in the history
In windows the exception message is ever so slightly differant than in
Linux and OSX. That is fine. We'll just catch either.
  • Loading branch information
nik9000 committed Jun 15, 2018
1 parent 3247012 commit 3c0a375
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
import static org.elasticsearch.client.RestClientTestUtil.getAllStatusCodes;
import static org.elasticsearch.client.RestClientTestUtil.randomErrorNoRetryStatusCode;
import static org.elasticsearch.client.RestClientTestUtil.randomOkStatusCode;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

Expand Down Expand Up @@ -214,7 +216,8 @@ public void testNodeSelector() throws IOException {
restClient.performRequest(request);
fail("expected to fail to connect");
} catch (ConnectException e) {
assertEquals("Connection refused", e.getMessage());
// This is different in windows and linux but this matches both.
assertThat(e.getMessage(), startsWith("Connection refused"));
}
} else {
Response response = restClient.performRequest(request);
Expand Down

0 comments on commit 3c0a375

Please sign in to comment.