diff options
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java index 9e7ae83617..e2ef28480f 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java @@ -21,8 +21,6 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.query.QueryParseContext; -import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationInitializationException; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; @@ -189,9 +187,8 @@ public class TopHitsTests extends BaseAggregationTestCase<TopHitsAggregationBuil " }\n" + "}"; XContentParser parser = createParser(JsonXContent.jsonXContent, source); - QueryParseContext parseContext = new QueryParseContext(parser); assertSame(XContentParser.Token.START_OBJECT, parser.nextToken()); - Exception e = expectThrows(AggregationInitializationException.class, () -> AggregatorFactories.parseAggregators(parseContext)); + Exception e = expectThrows(AggregationInitializationException.class, () -> AggregatorFactories.parseAggregators(parser)); assertThat(e.toString(), containsString("Aggregator [top_tags_hits] of type [top_hits] cannot accept sub-aggregations")); } |