From f3cfd364f9eb0efdec2abaffb3d48e6fc588ae1c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Dec 2023 08:44:40 +0300 Subject: Bump jjwt to 0.12.3 Upgrade API usage --- src/test/java/com/juick/server/tests/ServerTests.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/test/java/com') 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 jwt = Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(secret); + Jws 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 -- cgit v1.2.3