Skip to content

Commit 8425257

Browse files
committed
[TEST] Fix issue parsing response out of order
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).
1 parent ae912cb commit 8425257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private void doFromXContentTestWithRandomFields(boolean addRandomFields) throws
8181
parsedGetResponse = GetResponse.fromXContent(parser);
8282
assertNull(parser.nextToken());
8383
}
84-
assertEquals(expectedGetResponse, parsedGetResponse);
84+
assertEquals(expectedGetResponse.getSourceAsMap(), parsedGetResponse.getSourceAsMap());
8585
//print the parsed object out and test that the output is the same as the original output
8686
BytesReference finalBytes = toXContent(parsedGetResponse, xContentType, humanReadable);
8787
assertToXContentEquivalent(originalBytes, finalBytes, xContentType);

0 commit comments

Comments
 (0)