Skip to content

Commit

Permalink
Fix test for parse of search failures
Browse files Browse the repository at this point in the history
ShardSearchFailure.toXContent did not generate the outer level object,
fixed test to add this.

Related to backport of #42928
  • Loading branch information
henningandersen committed Jun 13, 2019
1 parent ab448da commit e08f3b1
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -41,7 +41,9 @@ public class RemoteResponseParsersTests extends ESTestCase {
public void testFailureWithoutIndex() throws IOException {
ShardSearchFailure failure = new ShardSearchFailure(new EsRejectedExecutionException("exhausted"));
XContentBuilder builder = jsonBuilder();
builder.startObject();
failure.toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
try (XContentParser parser = createParser(builder)) {
ScrollableHitSource.SearchFailure parsed = RemoteResponseParsers.SEARCH_FAILURE_PARSER.parse(parser, XContentType.JSON);
assertNotNull(parsed.getReason());
Expand Down

0 comments on commit e08f3b1

Please sign in to comment.