From 513c761aeedc7cf423ee11e5f5b5b08b12ed79ab Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Wed, 28 Aug 2013 10:32:59 +0200 Subject: [PATCH] ElasticsearchAssertions.assertHitCount also checks shard failures --- .../integration/search/basic/SearchWhileRelocatingTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/test/integration/search/basic/SearchWhileRelocatingTests.java b/src/test/java/org/elasticsearch/test/integration/search/basic/SearchWhileRelocatingTests.java index cbdd78d6788..37fc7c69b89 100644 --- a/src/test/java/org/elasticsearch/test/integration/search/basic/SearchWhileRelocatingTests.java +++ b/src/test/java/org/elasticsearch/test/integration/search/basic/SearchWhileRelocatingTests.java @@ -42,6 +42,7 @@ import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.gaussDecayFunction; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.equalTo; public class SearchWhileRelocatingTests extends AbstractSharedClusterTest { @@ -98,8 +99,8 @@ public class SearchWhileRelocatingTests extends AbstractSharedClusterTest { functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("loc", lonlat, "1000km")).boostMode( CombineFunction.MULT.getName())))).get(); + assertHitCount(sr, (long) (numDocs)); final SearchHits sh = sr.getHits(); - assertThat("Expect num docs in getTotalHits() ",sh.getTotalHits(), equalTo((long) (numDocs))); assertThat("Expected hits to be the same size the actual hits array", sh.getTotalHits(), equalTo((long) (sh.getHits().length))); }