@Test
  @Parameters(method = "getRegionTypeAndOperation")
  @TestCaseName("[{index}] {method}(RegionType:{0};Operation:{1})")
  public void indexesShouldNotBeAffectedByMethodAuthorizerChangeAfterRegionOperationOnClientWhenIndexedExpressionContainsMethodsAllowedByTheNewAuthorizer(
      RegionShortcut regionShortcut, Operation operation) {
    String regionName = testName.getMethodName();
    createAndPopulateRegion(regionName, regionShortcut);

    server.invoke(() -> {
      InternalCache internalCache = ClusterStartupRule.getCache();
      assertThat(internalCache).isNotNull();

      // Index is valid.
      QueryService queryService = internalCache.getQueryService();
      queryService.createIndex(NAME_INDEX_IDENTIFIER, "e." + QueryObject.GET_NAME_METHOD,
          SEPARATOR + regionName + " e");
      Index index =
          queryService.getIndex(internalCache.getRegion(regionName), NAME_INDEX_IDENTIFIER);
      assertThat(index.isValid()).isTrue();

      // Change the authorizer (still allow 'getName' to be executed)
      internalCache.getService(QueryConfigurationService.class).updateMethodAuthorizer(
          internalCache, false, TestMethodAuthorizer.class.getName(),
          Stream.of(QueryObject.GET_NAME_METHOD).collect(Collectors.toSet()));
    });

    // Execute operation on client side.
    executeOperationFromClient(regionName, operation);

    // Assert that operation succeeded and that index is still valid.
    server.invoke(() -> {
      InternalCache internalCache = ClusterStartupRule.getCache();
      assertThat(internalCache).isNotNull();
      QueryService queryService = internalCache.getQueryService();
      Region<Integer, QueryObject> region = internalCache.getRegion(regionName);
      Index indexInvalid =
          queryService.getIndex(internalCache.getRegion(regionName), NAME_INDEX_IDENTIFIER);
      assertThat(indexInvalid.isValid()).isTrue();
      assertRegionOperationResult(operation, region);
    });

    // No errors logged on server side.
    LogFileAssert.assertThat(logFile)
        .doesNotContain(RestrictedMethodAuthorizer.UNAUTHORIZED_STRING);
  }
The test creates an index with a method invocation as part of the expression, changes
the {@link MethodInvocationAuthorizer} to a custom one that still allows the method that is
invoked by the index and executes a region operation from the client that would cause an
index mapping removal/addition.
The operation should succeed, the index should still be valid and no errors should be logged.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/QueryConfigurationServiceConstraintsDistributedTest.java