Minor exception messages improvements.
Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
This commit is contained in:
parent
f8970af7f4
commit
de82ebf916
|
|
@ -97,7 +97,7 @@ public enum JwtSignatureAlgorithm {
|
|||
} else if (s.equals(EC.getName())) {
|
||||
family = EC;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported JWT token family algorithm: " + s);
|
||||
throw new IllegalArgumentException("Unsupported JWT family algorithm: " + s);
|
||||
}
|
||||
return family;
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ public enum JwtSignatureAlgorithm {
|
|||
} else if (s.equals(PS512.getName())) {
|
||||
algorithm = PS512;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported JWT token algorithm: " + s);
|
||||
throw new IllegalArgumentException("Unsupported JWT algorithm: " + s);
|
||||
}
|
||||
return algorithm;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class JwtBundleTest {
|
|||
JwtBundle.load(trustDomain, path);
|
||||
fail("should have thrown exception");
|
||||
} catch (JwtBundleException e) {
|
||||
assertEquals("Unsupported JWT token family algorithm: OKP", e.getCause().getMessage());
|
||||
assertEquals("Unsupported JWT family algorithm: OKP", e.getCause().getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class JwtSignatureAlgorithmTest {
|
|||
JwtSignatureAlgorithm.Family.parse("unknown family");
|
||||
fail();
|
||||
} catch (IllegalArgumentException e) {
|
||||
assertEquals("Unsupported JWT token family algorithm: unknown family", e.getMessage());
|
||||
assertEquals("Unsupported JWT family algorithm: unknown family", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ class JwtSignatureAlgorithmTest {
|
|||
JwtSignatureAlgorithm.parse("HS256");
|
||||
fail();
|
||||
} catch (IllegalArgumentException e) {
|
||||
assertEquals("Unsupported JWT token algorithm: HS256", e.getMessage());
|
||||
assertEquals("Unsupported JWT algorithm: HS256", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ class JwtSvidParseAndValidateTest {
|
|||
.jwtBundle(jwtBundle)
|
||||
.expectedAudience(Collections.singleton("audience"))
|
||||
.generateToken(() -> HS256TOKEN)
|
||||
.expectedException(new JwtSvidException("Unsupported JWT token algorithm: HS256"))
|
||||
.expectedException(new JwtSvidException("Unsupported JWT algorithm: HS256"))
|
||||
.build()),
|
||||
Arguments.of(TestCase.builder()
|
||||
.name("5. missing subject")
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class JwtSvidParseInsecureTest {
|
|||
.name("unsupported algorithm")
|
||||
.expectedAudience(Collections.singleton("audience"))
|
||||
.generateToken(() -> HS256TOKEN)
|
||||
.expectedException(new JwtSvidException("Unsupported JWT token algorithm: HS256"))
|
||||
.expectedException(new JwtSvidException("Unsupported JWT algorithm: HS256"))
|
||||
.build())
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue