@Test
  @Parameters({"MIN", "MAX", "AVG", "SUM", "COUNT"})
  public void parsingShouldThrowExceptionWhenAggregatesAreUsedAsPartOfTheWhereClauseWithoutAnInnerSelectQuery(
      String function) {
    String[] queries = new String[] {
        "SELECT * FROM " + SEPARATOR + "region WHERE " + function + "(id) > 0",
        "SELECT COUNT(id), status FROM " + SEPARATOR + "region WHERE " + function
            + "(id) > 0 GROUP BY status",
        "SELECT * FROM " + SEPARATOR + "region WHERE " + function + "(id) > 0 OR id < 0",
        "SELECT COUNT(id), status FROM " + SEPARATOR + "region WHERE " + function
            + "(id) > 0 OR id < 0 GROUP BY status",
        "SELECT * FROM " + SEPARATOR + "region WHERE id > 0 AND " + function + "(id) > 0",
        "SELECT COUNT(id), status FROM " + SEPARATOR + "region WHERE id > 0 AND " + function
            + "(id) > 0 GROUP BY status",
        "SELECT * FROM " + SEPARATOR + "region WHERE " + function + "(id) < ELEMENT(SELECT "
            + function
            + "(id) FROM " + SEPARATOR + "region)",
        "SELECT COUNT(id), status FROM " + SEPARATOR + "region WHERE " + function
            + "(id) < ELEMENT(SELECT "
            + function + "(id) FROM " + SEPARATOR + "region) GROUP BY status",
        "SELECT * FROM " + SEPARATOR + "region WHERE id > ELEMENT(SELECT id FROM " + SEPARATOR
            + "region WHERE " + function
            + "(id) > 0)",
        "SELECT id, status FROM " + SEPARATOR + "region WHERE id > ELEMENT(SELECT id FROM "
            + SEPARATOR + "region WHERE " + function
            + "(id) > 0)"
    };

    for (String queryString : queries) {
      QCompiler compiler = new QCompiler();
      assertThatThrownBy(() -> compiler.compileQuery(queryString))
          .as(String.format("Query parsing succeeded for %s but should have failed.", queryString))
          .isInstanceOf(QueryInvalidException.class)
          .hasMessageContaining("Aggregate functions can not be used as part of the WHERE clause");
    }
  }
This test is no more valid. From 6.6 Like is enhanced to support special chars (% and _) at any
place in the string pattern. With this the Like predicate is not transformed to
compiled-junction with > and < operator.
geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerTest.java