Skip to content

Commit

Permalink
[TEST] Fix issue parsing response out of order
Browse files Browse the repository at this point in the history
When parsing GetResponse it was possible that the equality check failed because
items in the map were in a different order (in the `.equals` implementation).
  • Loading branch information
dakrone committed Mar 14, 2018
1 parent ae912cb commit 8425257
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void doFromXContentTestWithRandomFields(boolean addRandomFields) throws
parsedGetResponse = GetResponse.fromXContent(parser);
assertNull(parser.nextToken());
}
assertEquals(expectedGetResponse, parsedGetResponse);
assertEquals(expectedGetResponse.getSourceAsMap(), parsedGetResponse.getSourceAsMap());
//print the parsed object out and test that the output is the same as the original output
BytesReference finalBytes = toXContent(parsedGetResponse, xContentType, humanReadable);
assertToXContentEquivalent(originalBytes, finalBytes, xContentType);
Expand Down

0 comments on commit 8425257

Please sign in to comment.