diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java index 5c824471f369e..4612ccb425ba2 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.esql.EsqlTestUtils; import org.elasticsearch.xpack.esql.EsqlTestUtils.TestSearchStats; +import org.elasticsearch.xpack.esql.action.EsqlCapabilities; import org.elasticsearch.xpack.esql.analysis.Analyzer; import org.elasticsearch.xpack.esql.analysis.AnalyzerContext; import org.elasticsearch.xpack.esql.analysis.EnrichResolution; diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/KqlQueryTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/KqlQueryTests.java index d46e83ef2520c..f790c07966c25 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/KqlQueryTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/KqlQueryTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.esql.querydsl.query; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.esql.core.expression.predicate.fulltext.StringQueryPredicate; import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.tree.SourceTests; import org.elasticsearch.xpack.esql.core.util.StringUtils; @@ -111,25 +110,24 @@ private static Map mutateOption(Map options, Str } public void testQueryBuilding() { - KqlQueryBuilder qb = getBuilder("case_insensitive=false"); + KqlQueryBuilder qb = getBuilder(Map.of("case_insensitive", "false")); assertThat(qb.caseInsensitive(), equalTo(false)); - qb = getBuilder("case_insensitive=false;time_zone=UTC;default_field=foo"); + qb = getBuilder(Map.of("case_insensitive", "false", "time_zone", "UTC", "default_field", "foo")); assertThat(qb.caseInsensitive(), equalTo(false)); assertThat(qb.timeZone(), equalTo(ZoneId.of("UTC"))); assertThat(qb.defaultField(), equalTo("foo")); - Exception e = expectThrows(IllegalArgumentException.class, () -> getBuilder("pizza=yummy")); + Exception e = expectThrows(IllegalArgumentException.class, () -> getBuilder(Map.of("pizza", "yummy"))); assertThat(e.getMessage(), equalTo("illegal kql query option [pizza]")); - e = expectThrows(ZoneRulesException.class, () -> getBuilder("time_zone=aoeu")); + e = expectThrows(ZoneRulesException.class, () -> getBuilder(Map.of("time_zone", "aoeu"))); assertThat(e.getMessage(), equalTo("Unknown time-zone ID: aoeu")); } - private static KqlQueryBuilder getBuilder(String options) { + private static KqlQueryBuilder getBuilder(Map options) { final Source source = new Source(1, 1, StringUtils.EMPTY); - final StringQueryPredicate predicate = new StringQueryPredicate(source, "eggplant", options); - final KqlQuery kqlQuery = new KqlQuery(source, "eggplant", predicate.optionMap()); + final KqlQuery kqlQuery = new KqlQuery(source, "eggplant", options); return (KqlQueryBuilder) kqlQuery.asBuilder(); }