diff options
author | Vitaly Takmazov | 2023-12-01 08:44:40 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-12-01 09:07:54 +0300 |
commit | f3cfd364f9eb0efdec2abaffb3d48e6fc588ae1c (patch) | |
tree | 898f9796acfb80052440ceb0d197c8a27971f026 /src/test/java | |
parent | a0b1b0050ce386d3e40d94b8b2973739877987b0 (diff) |
Bump jjwt to 0.12.3
Upgrade API usage
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index ce9b49d0..9a46f691 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2445,18 +2445,18 @@ public class ServerTests { } @Test - public void testAppleClientSecret() - throws NoSuchAlgorithmException, IOException, InvalidKeySpecException, NoSuchProviderException { + public void testAppleClientSecret() { String secret = new String(clientSecretGenerator.getClientSecret().getBytes(), StandardCharsets.UTF_8); final java.security.Key publicKey = clientSecretGenerator.getPublicKey(); - Jws<Claims> jwt = Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(secret); + Jws<Claims> jwt = Jwts.parser() + .setSigningKey(publicKey).build().parseClaimsJws(secret); assertThat(jwt.getHeader().get("kid"), is("keyid")); assertThat(jwt.getHeader().get("alg"), is("ES256")); - Claims claims = jwt.getBody(); - assertThat(claims.get("iss"), is("teamid")); - assertThat(claims.get("sub"), is("com.example.app")); - assertThat(claims.get("aud"), is("https://appleid.apple.com")); + Claims claims = jwt.getPayload(); + assertThat(claims.getIssuer(), is("teamid")); + assertThat(claims.getSubject(), is("com.example.app")); + assertThat(claims.getAudience().contains("https://appleid.apple.com"), is(true)); } @Test |