summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java
diff options
context:
space:
mode:
authorChristoph Büscher <christoph@elastic.co>2017-07-03 17:30:40 +0200
committerGitHub <noreply@github.com>2017-07-03 17:30:40 +0200
commitf576c987ce2615f77a8de75741b0f5448229805f (patch)
tree11f9e39ce1ad847b65c8c423d99d7c46d8fd7cca /core/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java
parent0e2cfc66bb8ad091d3cf5ade2833f9688af1240c (diff)
Remove QueryParseContext (#25486)
QueryParseContext is currently only used as a wrapper for an XContentParser, so this change removes it entirely and changes the appropriate APIs that use it so far to only accept a parser instead.
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.java5
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"));
}