File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
core/src/test/java/org/keycloak/sdjwt Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 3535import static org .junit .Assert .assertEquals ;
3636import static org .junit .Assert .assertNotNull ;
3737import static org .junit .Assert .assertThrows ;
38+ import static org .junit .Assert .assertTrue ;
3839
3940public abstract class SdJwsTest {
4041
@@ -195,12 +196,10 @@ public void shouldValidateAgeSinceIssued_IfJwtIsTooOld() {
195196 VerificationException exception = assertThrows (VerificationException .class , () -> {
196197 new ClaimVerifier .IatLifetimeCheck (0 , maxLifetime ).test (sdJws .getPayload ());
197198 });
198- assertEquals (String .format ("Token has expired by iat: now: '%s', expired at: '%s', "
199- + "iat: '%s', maxLifetime: '%s'" ,
200- now ,
201- iat + maxLifetime ,
202- iat ,
203- maxLifetime ), exception .getMessage ());
199+
200+ assertTrue (String .format ("Expected message '%s' does not match regex" , exception .getMessage ()),
201+ exception .getMessage ().matches ("Token has expired by iat: now: '\\ d+', expired at:"
202+ + " '\\ d+', iat: '\\ d+', maxLifetime: '180'" ));
204203 }
205204
206205 private JwsToken exampleSdJws (long iat ) {
You can’t perform that action at this time.
0 commit comments