From 9b1d1b239ce7225b96f20fa8acc1892ee3d47031 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Mon, 5 Oct 2015 14:31:45 +0100 Subject: [PATCH] fixes --- .../action/count/CountRequestBuilderTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/action/count/CountRequestBuilderTests.java b/core/src/test/java/org/elasticsearch/action/count/CountRequestBuilderTests.java index f9640281ed6..c3a6447ca09 100644 --- a/core/src/test/java/org/elasticsearch/action/count/CountRequestBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/action/count/CountRequestBuilderTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.test.ESTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -56,14 +57,16 @@ public class CountRequestBuilderTests extends ESTestCase { @Test public void testEmptySourceToString() { CountRequestBuilder countRequestBuilder = client.prepareCount(); - assertThat(countRequestBuilder.toString(), equalTo(new SearchSourceBuilder().size(0).toString())); + assertThat(countRequestBuilder.toString(), equalTo(new SearchSourceBuilder().size(0).minScore(CountRequest.DEFAULT_MIN_SCORE) + .terminateAfter(SearchContext.DEFAULT_TERMINATE_AFTER).toString())); } @Test public void testQueryBuilderQueryToString() { CountRequestBuilder countRequestBuilder = client.prepareCount(); countRequestBuilder.setQuery(QueryBuilders.matchAllQuery()); - assertThat(countRequestBuilder.toString(), equalTo(new SearchSourceBuilder().size(0).query(QueryBuilders.matchAllQuery()) + assertThat(countRequestBuilder.toString(), equalTo(new SearchSourceBuilder().size(0).minScore(CountRequest.DEFAULT_MIN_SCORE) + .terminateAfter(SearchContext.DEFAULT_TERMINATE_AFTER).query(QueryBuilders.matchAllQuery()) .toString())); }