From c8ee64d0cbf2da1f332d27e74fef69bd96f4f674 Mon Sep 17 00:00:00 2001 From: jaymode Date: Tue, 1 Mar 2016 09:30:12 -0500 Subject: [PATCH] test: sort by _uid to get consistent ordering Original commit: elastic/x-pack-elasticsearch@73b5c49ea528237cb3cb79d7c0050f9103607b4f --- .../integration/DocumentAndFieldLevelSecurityTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java index bb685de20bf..bbdbcba113d 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.integration; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexModule; +import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.shield.Shield; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; @@ -111,6 +112,7 @@ public class DocumentAndFieldLevelSecurityTests extends ShieldIntegTestCase { response = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user4", USERS_PASSWD))) .prepareSearch("test") + .addSort("_uid", SortOrder.ASC) .get(); assertHitCount(response, 2); assertSearchHits(response, "1", "2"); @@ -163,6 +165,7 @@ public class DocumentAndFieldLevelSecurityTests extends ShieldIntegTestCase { response = client().filterWithHeader( Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user4", USERS_PASSWD))) .prepareSearch("test") + .addSort("_uid", SortOrder.ASC) .get(); assertHitCount(response, 2); assertThat(response.getHits().getAt(0).getId(), equalTo("1"));