@Test
  @Parameters(named = "parameters")
  @TestCaseName("{method}(regionShortcut={0}, operation={1}, executeWithInitialResults={2})")
  public void cqsShouldSucceedDuringEventProcessingAfterRegionOperationWhenMethodAuthorizerIsChangedAndQueryContainsMethodsAllowedByTheNewAuthorizer(
      RegionShortcut regionShortcut, Operation operation, boolean executeWithInitialResults) {
    serverVM.invoke(() -> {
      createRegion(regionShortcut);
      populateRegion();
    });

    clientVM.invoke(() -> createClientCq(queryString, executeWithInitialResults));

    serverVM.invoke(() -> {
      InternalCache internalCache = (InternalCache) serverLauncher.getCache();
      assertThat(internalCache.getCqService().getAllCqs()).hasSize(1);

      // Make Sure Cq is running before continuing.
      internalCache.getCqService().getAllCqs()
          .forEach(cq -> await().untilAsserted(() -> assertThat(cq.isRunning()).isTrue()));

      // Change the authorizer (still allow 'getId' to be executed)
      internalCache.getService(QueryConfigurationService.class).updateMethodAuthorizer(
          internalCache, true, TestMethodAuthorizer.class.getName(),
          Stream.of(GET_ID_METHOD).collect(toSet()));

      // Execute operations that would cause the CQ to process the event.
      doOperations(operation);

      validateRegionValues();
    });

    clientVM.invoke(() -> {
      await().untilAsserted(
          () -> assertThat(cqListener.getEventCount()).isEqualTo(Operation.values().length));
      assertThat(cqListener.getErrorCount()).isEqualTo(0);
    });

    // No errors logged on server side.
    File logFile = new File(new File(temporaryFolder.getRoot(), "server"), "server.log");
    LogFileAssert
        .assertThat(logFile)
        .doesNotContain(RestrictedMethodAuthorizer.UNAUTHORIZED_STRING);
  }
The test creates a CQ with a method invocation as part of the expression, changes
the {@link MethodInvocationAuthorizer} to a custom one that still allows the methods part of
the expression and executes all region operations that would fire the CQ.
The operations should succeed, the CQ should fire 'onEvent' and no errors should be logged.
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/internal/QueryConfigurationServiceConstraintsDistributedTest.java