MrtnBalazs commented on code in PR #622:
URL: https://github.com/apache/knox/pull/622#discussion_r952513040
##########
gateway-server/src/test/java/org/apache/knox/gateway/session/control/InMemoryConcurrentSessionVerifierTest.java:
##########
@@ -316,25 +296,27 @@ public void testBackgroundThreadRemoveExpiredTokens()
throws ServiceLifecycleExc
verifier.verifySessionForUser("admin", adminToken2);
JWT expiringAdminToken =
tokenAuthority.issueToken(expiringJwtAttributesForAdmin);
verifier.verifySessionForUser("admin", expiringAdminToken);
- Assert.assertEquals(3, verifier.countValidTokensForUser("admin"));
- Thread.sleep(1100);
- Assert.assertEquals(2, verifier.countValidTokensForUser("admin"));
+ Assert.assertEquals(3, verifier.getTokenCountForUser("admin").intValue());
+ Thread.sleep(1050);
Review Comment:
It is for waiting until the token expires, but i realised i could just issue
already expired tokens and skip the waiting. That would probably check the same
functionality. I will change it that way and remove the sleep (at the other
places as well)
--
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]