summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java')
-rw-r--r--core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java b/core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java
index 58e2409cde..2960a6e23d 100644
--- a/core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java
+++ b/core/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java
@@ -19,11 +19,14 @@
package org.elasticsearch.search.suggest.completion;
+import org.elasticsearch.common.ParseFieldMatcher;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
+import org.elasticsearch.index.query.QueryParseContext;
+import org.elasticsearch.indices.query.IndicesQueriesRegistry;
import org.elasticsearch.test.ESTestCase;
import java.io.IOException;
@@ -40,7 +43,7 @@ public abstract class QueryContextTestCase<QC extends ToXContent> extends ESTest
/**
* read the context
*/
- protected abstract QC fromXContent(XContentParser parser) throws IOException;
+ protected abstract QC fromXContent(QueryParseContext context) throws IOException;
public void testToXContext() throws IOException {
for (int i = 0; i < NUMBER_OF_RUNS; i++) {
@@ -50,7 +53,7 @@ public abstract class QueryContextTestCase<QC extends ToXContent> extends ESTest
BytesReference bytesReference = builder.bytes();
XContentParser parser = XContentFactory.xContent(bytesReference).createParser(bytesReference);
parser.nextToken();
- QC fromXContext = fromXContent(parser);
+ QC fromXContext = fromXContent(new QueryParseContext(new IndicesQueriesRegistry(), parser, ParseFieldMatcher.STRICT));
assertEquals(toXContent, fromXContext);
assertEquals(toXContent.hashCode(), fromXContext.hashCode());
}