]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7610 set missing min_doc_count in a test
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 20 May 2016 13:14:53 +0000 (15:14 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 24 May 2016 21:12:58 +0000 (23:12 +0200)
server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java

index afdad69ff9d21544a8a073a67a93815fd980163c..f6c5163cc87fd8ae746cb118e94555f531ef9256 100644 (file)
@@ -20,6 +20,9 @@
 package org.sonar.server.search;
 
 import com.google.common.collect.ImmutableMap;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Map;
 import org.elasticsearch.action.search.SearchRequestBuilder;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.search.aggregations.AggregationBuilders;
@@ -31,10 +34,6 @@ import org.sonar.api.utils.DateUtils;
 import org.sonar.server.es.EsTester;
 import org.sonar.server.es.NewIndex.NewIndexType;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Map;
-
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
@@ -136,6 +135,7 @@ public class FacetsMediumTest {
     SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE)
       .addAggregation(
         AggregationBuilders.dateHistogram(FIELD_CREATED_AT)
+          .minDocCount(0L)
           .field(FIELD_CREATED_AT)
           .interval(Interval.MINUTE)
           .format(DateUtils.DATETIME_FORMAT));
@@ -150,7 +150,7 @@ public class FacetsMediumTest {
   }
 
   private static Map<String, Object> newTagsDocument(String key, String... tags) {
-    ImmutableMap<String, Object> doc = ImmutableMap.<String, Object>of(
+    ImmutableMap<String, Object> doc = ImmutableMap.of(
       FIELD_KEY, key,
       FIELD_TAGS, Arrays.asList(tags),
       FIELD_CREATED_AT, new Date());