-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ConfigValidatorUtilTest, Removed unused imports in UIDOperatorV…
…erticleTest
- Loading branch information
Behnam Mozafari
committed
Dec 18, 2024
1 parent
491025b
commit 8018196
Showing
2 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/com/uid2/operator/service/ConfigValidatorUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.uid2.operator.service; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class ConfigValidatorUtilTest { | ||
@Test | ||
void testValidateIdentityRefreshTokens() { | ||
// identityExpiresAfter is greater than refreshExpiresAfter | ||
assertFalse(ConfigValidatorUtil.validateIdentityRefreshTokens(10, 5, 3)); | ||
|
||
// refreshIdentityAfter is greater than identityExpiresAfter | ||
assertFalse(ConfigValidatorUtil.validateIdentityRefreshTokens(5, 10, 6)); | ||
|
||
// refreshIdentityAfter is greater than refreshExpiresAfter | ||
assertFalse(ConfigValidatorUtil.validateIdentityRefreshTokens(5, 10, 11)); | ||
|
||
// all conditions are valid | ||
assertTrue(ConfigValidatorUtil.validateIdentityRefreshTokens(5, 10, 3)); | ||
} | ||
|
||
@Test | ||
void testValidateBidstreamLifetime() { | ||
// maxBidstreamLifetimeSeconds is less than identityTokenExpiresAfterSeconds | ||
assertFalse(ConfigValidatorUtil.validateBidstreamLifetime(5, 10)); | ||
|
||
// maxBidstreamLifetimeSeconds is greater than or equal to identityTokenExpiresAfterSeconds | ||
assertTrue(ConfigValidatorUtil.validateBidstreamLifetime(10, 5)); | ||
assertTrue(ConfigValidatorUtil.validateBidstreamLifetime(10, 10)); | ||
} | ||
} |