Skip to content

Commit ac0982a

Browse files
committed
Fix naming and visibility of helper methods
1 parent 0742884 commit ac0982a

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,24 +1216,23 @@ public void testMatchInsideEval() throws Exception {
12161216
}
12171217

12181218
public void testFieldBasedFullTextFunctions() throws Exception {
1219-
testFieldBasedWithNonIndexedColumn("MATCH", "match(text, \"cat\")", "function");
1220-
testFieldBasedFunctionNotAllowedAfterCommands("MATCH", "function", "match(title, \"Meditation\")");
1219+
checkFieldBasedWithNonIndexedColumn("MATCH", "match(text, \"cat\")", "function");
1220+
checkFieldBasedFunctionNotAllowedAfterCommands("MATCH", "function", "match(title, \"Meditation\")");
12211221

1222-
testFieldBasedWithNonIndexedColumn(":", "text : \"cat\"", "operator");
1223-
testFieldBasedFunctionNotAllowedAfterCommands(":", "operator", "title : \"Meditation\"");
1222+
checkFieldBasedWithNonIndexedColumn(":", "text : \"cat\"", "operator");
1223+
checkFieldBasedFunctionNotAllowedAfterCommands(":", "operator", "title : \"Meditation\"");
12241224

12251225
if (EsqlCapabilities.Cap.MULTI_MATCH_FUNCTION.isEnabled()) {
1226-
testFieldBasedWithNonIndexedColumn("MultiMatch", "multi_match(\"cat\", text)", "function");
1227-
testFieldBasedFunctionNotAllowedAfterCommands("MultiMatch", "function", "multi_match(\"Meditation\", title)");
1226+
checkFieldBasedWithNonIndexedColumn("MultiMatch", "multi_match(\"cat\", text)", "function");
1227+
checkFieldBasedFunctionNotAllowedAfterCommands("MultiMatch", "function", "multi_match(\"Meditation\", title)");
12281228
}
12291229
if (EsqlCapabilities.Cap.TERM_FUNCTION.isEnabled()) {
1230-
testFieldBasedWithNonIndexedColumn("Term", "term(text, \"cat\")", "function");
1231-
testFieldBasedFunctionNotAllowedAfterCommands("Term", "function", "term(title, \"Meditation\")");
1230+
checkFieldBasedWithNonIndexedColumn("Term", "term(text, \"cat\")", "function");
1231+
checkFieldBasedFunctionNotAllowedAfterCommands("Term", "function", "term(title, \"Meditation\")");
12321232
}
12331233
}
12341234

1235-
public void testFieldBasedFunctionNotAllowedAfterCommands(String functionName, String functionType, String functionInvocation)
1236-
throws Exception {
1235+
private void checkFieldBasedFunctionNotAllowedAfterCommands(String functionName, String functionType, String functionInvocation) {
12371236
assertThat(
12381237
error("from test | limit 10 | where " + functionInvocation, fullTextAnalyzer),
12391238
containsString("[" + functionName + "] " + functionType + " cannot be used after LIMIT")
@@ -1246,7 +1245,7 @@ public void testFieldBasedFunctionNotAllowedAfterCommands(String functionName, S
12461245
}
12471246

12481247
// These should pass eventually once we lift some restrictions on match function
1249-
public void testFieldBasedWithNonIndexedColumn(String functionName, String functionInvocation, String functionType) {
1248+
private void checkFieldBasedWithNonIndexedColumn(String functionName, String functionInvocation, String functionType) {
12501249
assertThat(
12511250
error("from test | eval text = substring(title, 1) | where " + functionInvocation, fullTextAnalyzer),
12521251
containsString(
@@ -1265,15 +1264,12 @@ public void testFieldBasedWithNonIndexedColumn(String functionName, String funct
12651264
assertThat(keywordError, containsString("which is not a field from an index mapping"));
12661265
}
12671266

1268-
public void testQueryStringFunctionsNotAllowedAfterCommands() throws Exception {
1269-
testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands("QSTR", "qstr(\"field_name: Meditation\")");
1270-
}
1271-
1272-
public void testKqlFunctionsNotAllowedAfterCommands() throws Exception {
1273-
testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands("KQL", "kql(\"field_name: Meditation\")");
1267+
public void testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands() throws Exception {
1268+
checkNonFieldBasedFullTextFunctionsNotAllowedAfterCommands("QSTR", "qstr(\"field_name: Meditation\")");
1269+
checkNonFieldBasedFullTextFunctionsNotAllowedAfterCommands("KQL", "kql(\"field_name: Meditation\")");
12741270
}
12751271

1276-
public void testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands(String functionName, String functionInvocation) throws Exception {
1272+
private void checkNonFieldBasedFullTextFunctionsNotAllowedAfterCommands(String functionName, String functionInvocation) {
12771273
// Source commands
12781274
assertThat(
12791275
error("show info | where " + functionInvocation),

0 commit comments

Comments
 (0)