mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
DefaultCryptoSdJwsTest.shouldValidateAgeSinceIssued_IfJwtIsTooOld() sometimes fails in CI
closes #44971 Signed-off-by: mposolda <mposolda@gmail.com>
This commit is contained in:
parent
92314bccc6
commit
08e96435c8
@ -35,6 +35,7 @@ import org.junit.Test;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertThrows;
|
import static org.junit.Assert.assertThrows;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
public abstract class SdJwsTest {
|
public abstract class SdJwsTest {
|
||||||
|
|
||||||
@ -195,12 +196,10 @@ public abstract class SdJwsTest {
|
|||||||
VerificationException exception = assertThrows(VerificationException.class, () -> {
|
VerificationException exception = assertThrows(VerificationException.class, () -> {
|
||||||
new ClaimVerifier.IatLifetimeCheck(0, maxLifetime).test(sdJws.getPayload());
|
new ClaimVerifier.IatLifetimeCheck(0, maxLifetime).test(sdJws.getPayload());
|
||||||
});
|
});
|
||||||
assertEquals(String.format("Token has expired by iat: now: '%s', expired at: '%s', "
|
|
||||||
+ "iat: '%s', maxLifetime: '%s'",
|
assertTrue(String.format("Expected message '%s' does not match regex", exception.getMessage()),
|
||||||
now,
|
exception.getMessage().matches("Token has expired by iat: now: '\\d+', expired at:"
|
||||||
iat + maxLifetime,
|
+ " '\\d+', iat: '\\d+', maxLifetime: '180'"));
|
||||||
iat,
|
|
||||||
maxLifetime), exception.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JwsToken exampleSdJws(long iat) {
|
private JwsToken exampleSdJws(long iat) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user