DonalEvans commented on a change in pull request #7122:
URL: https://github.com/apache/geode/pull/7122#discussion_r752696284



##########
File path: 
geode-core/src/upgradeTest/java/org/apache/geode/security/AuthExpirationBackwardCompatibleDUnitTest.java
##########
@@ -387,6 +390,72 @@ public void 
cqOlderClientWithClientInteractionWillDeliverEventEventually() throw
     });
   }
 
+  @Test
+  public void createCQWillReAuth() throws Exception {
+    int serverPort = server.getPort();
+    clientVM = cluster.startClientVM(0, clientVersion,
+        c -> c.withProperty(SECURITY_CLIENT_AUTH_INIT, 
UpdatableUserAuthInitialize.class.getName())
+            .withPoolSubscription(true)
+            .withServerConnection(serverPort));
+
+    clientVM.invoke(() -> {
+      UpdatableUserAuthInitialize.setUser("user1");
+      Region<Object, Object> proxyRegion =
+          ClusterStartupRule.clientCacheRule.createProxyRegion("region");
+      proxyRegion.put("key1", "value1");
+    });
+
+    getSecurityManager().addExpiredUser("user1");
+
+    clientVM.invoke(() -> {
+      UpdatableUserAuthInitialize.setUser("user2");
+      QueryService queryService = 
ClusterStartupRule.getClientCache().getQueryService();
+      CqQuery cq =
+          queryService.newCq("CQ1", "select * from /region", new 
CqAttributesFactory().create());
+      cq.execute();
+    });
+
+    Map<String, List<String>> unAuthorizedOps = 
getSecurityManager().getUnAuthorizedOps();
+    Map<String, List<String>> authorizedOps = 
getSecurityManager().getAuthorizedOps();
+    assertThat(unAuthorizedOps.keySet()).containsExactly("user1");
+    
assertThat(unAuthorizedOps.get("user1")).containsExactly("DATA:READ:region");
+    assertThat(authorizedOps.keySet()).containsExactly("user1", "user2");
+    assertThat(authorizedOps.get("user2")).containsExactly("DATA:READ:region");
+  }
+
+  @Test
+  public void stopCQ() throws Exception {

Review comment:
       This test name could be more descriptive. Something like 
"stopCQTriggersClientReAuthentication" maybe?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to