Skip to content

Commit

Permalink
Exception -> IllegalArgumentException
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Mierzwa <[email protected]>
  • Loading branch information
MaciejMierzwa committed Oct 5, 2023
1 parent a245f58 commit 3002f11
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void testCreateJwtWithRoleSecurityMode() throws Exception {
assertThat(signedJWT.getJWTClaimsSet().getClaims().get("exp"), is(notNullValue()));
assertThat(signedJWT.getJWTClaimsSet().getClaims().get("br"), is(notNullValue()));
assertThat(signedJWT.getJWTClaimsSet().getClaims().get("br").toString(), equalTo(expectedBackendRoles));

EncryptionDecryptionUtil encryptionUtil = new EncryptionDecryptionUtil(claimsEncryptionKey);
assertThat(encryptionUtil.decrypt(signedJWT.getJWTClaimsSet().getClaims().get("er").toString()), equalTo(expectedRoles));
}
Expand All @@ -138,7 +139,7 @@ public void testCreateJwtWithBadExpiry() {
throw new RuntimeException(e);
}
});
Assert.assertEquals("java.lang.Exception: The expiration time should be a positive integer", exception.getMessage());
Assert.assertEquals("java.lang.IllegalArgumentException: The expiration time should be a positive integer", exception.getMessage());
}

@Test
Expand Down Expand Up @@ -179,6 +180,6 @@ public void testCreateJwtWithBadRoles() {
throw new RuntimeException(e);
}
});
Assert.assertEquals("java.lang.Exception: Roles cannot be null", exception.getMessage());
Assert.assertEquals("java.lang.IllegalArgumentException: Roles cannot be null", exception.getMessage());
}
}

0 comments on commit 3002f11

Please sign in to comment.