@Test
  public void dataWriteCannotGet() throws Exception {
    Properties props = getVMPropertiesWithPermission("dataWrite");
    if (shouldSetObjectFilterProperty(clientVmConfiguration)) {
      props.setProperty(ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER,
          "org.apache.geode.security.templates.UsernamePrincipal");
    }
    int locatorPort = locator.getPort();

    ClientVM client = csRule.startClientVM(2, clientVmConfiguration, props,
        cf -> cf.addPoolLocator("localhost", locatorPort));

    // Client cannot get through any avenue
    client.invoke(() -> {
      ClientCache cache = ClusterStartupRule.getClientCache();
      ClientRegionFactory<String, String> rf =
          cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
      Region<String, String> region = rf.create(regionName);

      assertThatThrownBy(() -> region.get(initKey))
          .hasCauseInstanceOf(NotAuthorizedException.class);
      assertThatThrownBy(() -> region.get(singleKey, null))
          .hasCauseInstanceOf(NotAuthorizedException.class);
      // An unauthorized getAll does not throw; it just does not return the requested values.
      // See GEODE-3632.
      assertThat(region.getAll(keyValueMap.keySet())).isEmpty();
      assertThat(region.getAll(keyValueMap.keySet(), null)).isEmpty();
    });
  }
Tests for authorization from client to server for data puts and gets. For similar test in the
case of failover, see {@link ClientDataAuthorizationUsingLegacySecurityWithFailoverDUnitTest}.

@since GemFire 5.5
geode-core/src/upgradeTest/java/org/apache/geode/security/ClientDataAuthorizationUsingLegacySecurityDUnitTest.java