File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
gateway-service/src/test/java/org/zowe/apiml/gateway/security/service Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -558,17 +558,17 @@ void testGetLtpaTokenException() {
558
558
}
559
559
560
560
@ Test
561
- void testCreateJwtTokenUserExpire () {
561
+ void testCreateJwtTokensAndCheckExpiration () {
562
562
String jwt1 = authService .createJwtToken ("user" , "domain" , "ltpaToken" );
563
563
String jwt2 = authService .createJwtToken ("expire" , "domain" , "ltpaToken" );
564
564
565
565
QueryResponse qr1 = authService .parseJwtToken (jwt1 );
566
566
QueryResponse qr2 = authService .parseJwtToken (jwt2 );
567
567
568
- assertEquals (
569
- qr1 . getExpiration (). getTime () - authConfigurationProperties .getTokenProperties ().getExpirationInSeconds () * 1000 ,
570
- qr2 .getExpiration (). getTime () - authConfigurationProperties . getTokenProperties (). getShortTtlExpirationInSeconds () * 1000
571
- );
568
+ Date toBeExpired = DateUtils . addSeconds ( qr1 . getCreation (), authConfigurationProperties . getTokenProperties (). getExpirationInSeconds ());
569
+ Date toBeExpired2 = DateUtils . addSeconds ( qr2 . getCreation (), ( int ) authConfigurationProperties .getTokenProperties ().getShortTtlExpirationInSeconds ());
570
+ assertEquals ( qr1 .getExpiration (), toBeExpired );
571
+ assertEquals ( qr2 . getExpiration (), toBeExpired2 );
572
572
}
573
573
574
574
@ Test
You can’t perform that action at this time.
0 commit comments