From fc8466675652ad434431f6adf1a48291e08740ed Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Tue, 4 Nov 2014 20:12:12 +0100 Subject: [PATCH] Tests: Fix GroovyScriptTests to not depend on the way documents are routed to shards. --- .../java/org/elasticsearch/script/GroovyScriptTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/script/GroovyScriptTests.java b/src/test/java/org/elasticsearch/script/GroovyScriptTests.java index 2da01f435c2..dbdf586f498 100644 --- a/src/test/java/org/elasticsearch/script/GroovyScriptTests.java +++ b/src/test/java/org/elasticsearch/script/GroovyScriptTests.java @@ -31,10 +31,14 @@ import java.util.List; import static com.google.common.collect.Lists.newArrayList; import static org.elasticsearch.index.query.FilterBuilders.scriptFilter; -import static org.elasticsearch.index.query.QueryBuilders.*; +import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; +import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; +import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; +import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertOrderedSearchHits; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits; import static org.hamcrest.Matchers.equalTo; /** @@ -119,7 +123,7 @@ public class GroovyScriptTests extends ElasticsearchIntegrationTest { .boostMode(CombineFunction.REPLACE)).get(); assertNoFailures(resp); - assertOrderedSearchHits(resp, "3", "1"); + assertSearchHits(resp, "3", "1"); // doc[] access resp = client().prepareSearch("test").setQuery(functionScoreQuery(matchAllQuery())