aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java14
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