summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/action/support
diff options
context:
space:
mode:
authorLuca Cavanna <javanna@users.noreply.github.com>2017-04-05 11:12:34 +0200
committerGitHub <noreply@github.com>2017-04-05 11:12:34 +0200
commit318d365b12648daf4231430ae0c5257f83d1da80 (patch)
tree45d5fc75523535060507aaa181f14235a29a6849 /core/src/test/java/org/elasticsearch/action/support
parentafd45c14327cd0f8d155e5ac9740f48e8e39b09c (diff)
[TEST] make sure that fromXContent doesn't rely on keys ordering (#23901)
We shuffle the keys before we parse our responses for the high level client so that we make sure we never rely on keys ordering.
Diffstat (limited to 'core/src/test/java/org/elasticsearch/action/support')
-rw-r--r--core/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java b/core/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java
index 58f77db339..fd61bbc6d7 100644
--- a/core/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java
+++ b/core/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java
@@ -25,6 +25,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.breaker.CircuitBreakingException;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.collect.Tuple;
+import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.shard.ShardId;
@@ -76,7 +77,7 @@ public class ReplicationResponseTests extends ESTestCase {
final XContentType xContentType = randomFrom(XContentType.values());
boolean humanReadable = randomBoolean();
- BytesReference originalBytes = toXContent(shardInfo, xContentType, humanReadable);
+ BytesReference originalBytes = toShuffledXContent(shardInfo, xContentType, ToXContent.EMPTY_PARAMS, humanReadable);
// Shuffle the XContent fields
if (randomBoolean()) {