@Test
  public void creationShouldThrowQueryInvalidExceptionForInvalidQueries() {
    CqAttributes attrs = new CqAttributesFactory().create();
    String[] invalidQueries = new String[] {
        "I AM NOT A QUERY",
        "SELECT * FROM " + SEPARATOR + "region WHERE MIN(id) > 0",
        "SELECT * FROM " + SEPARATOR + "region WHERE MAX(id) > 0",
        "SELECT * FROM " + SEPARATOR + "region WHERE AVG(id) > 0",
        "SELECT * FROM " + SEPARATOR + "region WHERE SUM(id) > 0",
        "SELECT * FROM " + SEPARATOR + "region WHERE COUNT(id) > 0",
    };

    for (String queryString : invalidQueries) {
      assertThatThrownBy(() -> queryService.newCq(queryString, attrs))
          .as(String.format("Query creation succeeded for %s but should have failed.", queryString))
          .isInstanceOf(QueryInvalidException.class);
    }
  }
Test to make sure CQs that have invalid syntax throw QueryInvalidException, and CQs that have
unsupported CQ features throw UnsupportedOperationException
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/ContinuousQueryValidationDUnitTest.java