jmelchio commented on a change in pull request #6755:
URL: https://github.com/apache/geode/pull/6755#discussion_r688057095



##########
File path: 
geode-core/src/upgradeTest/java/org/apache/geode/security/AuthExpirationDUnitTest.java
##########
@@ -109,4 +114,82 @@ public void 
clientShouldReAuthenticateWhenCredentialExpiredAndOperationSucceed()
     assertThat(region.size()).isEqualTo(2);
   }
 
+  @Test
+  public void 
userShouldReAuthenticateWhenCredentialExpiredAndOperationSucceed() throws 
Exception {
+    int serverPort = server.getPort();
+    ClientVM clientVM = lsRule.startClientVM(0, clientVersion,
+        c -> c.withMultiUser(true)
+            .withProperty(SECURITY_CLIENT_AUTH_INIT, 
UpdatableUserAuthInitialize.class.getName())
+            .withPoolSubscription(true)
+            .withServerConnection(serverPort));
+
+    clientVM.invoke(() -> {
+      UpdatableUserAuthInitialize.setUser("serviceUser0");
+      UpdatableUserAuthInitialize.setAttempts(0);
+      UpdatableUserAuthInitialize.setAlternate(false);
+      ClientCache clientCache = ClusterStartupRule.getClientCache();
+      assert clientCache != null;
+      
clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region");
+      Properties userSecurityProperties = new Properties();
+      userSecurityProperties.put("security-username", "serviceUser0");
+      userSecurityProperties.put("security-password", "serviceUser0");
+      RegionService regionService = 
clientCache.createAuthenticatedView(userSecurityProperties);
+      Region<Object, Object> region = regionService.getRegion("/region");
+      region.put(0, "value0");
+      regionService.close();
+    });
+

Review comment:
       > I am confused about the repetition of the `clientvm blocks rather than 
continuing it.
   
   You're right, in most cases they can be continued. I organized it this way 
as logical steps but unless we add a user to the expired user list in between 
there is no need for separation of the blocks. I will change it.




-- 
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