From fc7c35d9a0a30cf1234a48bd7a4d48476e9c8aa1 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Mon, 26 Aug 2019 15:29:13 -0600 Subject: [PATCH] Fix compilation in CumulativeCardinalityAggregatorTests Some generics were specified at too fine-grained a level. --- .../CumulativeCardinalityAggregatorTests.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/data-science/src/test/java/org/elasticsearch/xpack/datascience/cumulativecardinality/CumulativeCardinalityAggregatorTests.java b/x-pack/plugin/data-science/src/test/java/org/elasticsearch/xpack/datascience/cumulativecardinality/CumulativeCardinalityAggregatorTests.java index 9cf2c9846b223..b8f48e2d0704c 100644 --- a/x-pack/plugin/data-science/src/test/java/org/elasticsearch/xpack/datascience/cumulativecardinality/CumulativeCardinalityAggregatorTests.java +++ b/x-pack/plugin/data-science/src/test/java/org/elasticsearch/xpack/datascience/cumulativecardinality/CumulativeCardinalityAggregatorTests.java @@ -116,12 +116,12 @@ public void testAllNull() throws IOException { } public void testParentValidations() throws IOException { - ValuesSourceConfig numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC); + ValuesSourceConfig valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC); // Histogram Set aggBuilders = new HashSet<>(); aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum")); - AggregatorFactory parent = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d, + AggregatorFactory parent = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d, mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null, new AggregatorFactories.Builder(), Collections.emptyMap()); CumulativeCardinalityPipelineAggregationBuilder builder @@ -131,7 +131,7 @@ public void testParentValidations() throws IOException { // Date Histogram aggBuilders.clear(); aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum")); - parent = new DateHistogramAggregatorFactory("name", numericVS, 0L, + parent = new DateHistogramAggregatorFactory("name", valuesSource, 0L, mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class), mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class), new AggregatorFactories.Builder(), Collections.emptyMap()); @@ -139,6 +139,7 @@ public void testParentValidations() throws IOException { builder.validate(parent, Collections.emptySet(), aggBuilders); // Auto Date Histogram + ValuesSourceConfig numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC); aggBuilders.clear(); aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum")); AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1]; @@ -229,15 +230,16 @@ private static long asLong(String dateTime) { private static AggregatorFactory getRandomSequentiallyOrderedParentAgg() throws IOException { AggregatorFactory factory; + ValuesSourceConfig valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC); ValuesSourceConfig numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC); switch (randomIntBetween(0, 2)) { case 0: - factory = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d, + factory = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d, mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null, new AggregatorFactories.Builder(), Collections.emptyMap()); break; case 1: - factory = new DateHistogramAggregatorFactory("name", numericVS, 0L, + factory = new DateHistogramAggregatorFactory("name", valuesSource, 0L, mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class), mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class), new AggregatorFactories.Builder(), Collections.emptyMap());