[TEST] Fix BytesRestResponseTests.testNoErrorFromXContent

This commit is contained in:
Tanguy Leroux 2017-02-01 10:34:42 +01:00
parent 5bf9cb9f70
commit 3cfcd1acb7
1 changed files with 3 additions and 3 deletions

View File

@ -342,10 +342,10 @@ public class BytesRestResponseTests extends ESTestCase {
}
public void testNoErrorFromXContent() throws IOException {
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> {
IllegalStateException e = expectThrows(IllegalStateException.class, () -> {
try (XContentBuilder builder = XContentBuilder.builder(randomFrom(XContentType.values()).xContent())) {
builder.startObject();
builder.field("status", randomFrom(RestStatus.values()));
builder.field("status", randomFrom(RestStatus.values()).getStatus());
builder.endObject();
try (XContentParser parser = createParser(builder.contentType().xContent(), builder.bytes())) {
@ -353,7 +353,7 @@ public class BytesRestResponseTests extends ESTestCase {
}
}
});
assertEquals("Unable to parse elasticsearch status exception", e.getMessage());
assertEquals("Failed to parse elasticsearch status exception: no exception was found", e.getMessage());
}
public static class WithHeadersException extends ElasticsearchException {