aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-05-13 00:37:35 +0300
committerGravatar Vitaly Takmazov2022-05-13 00:42:10 +0300
commitef2c53357a9e7b3b33644cfaa2e3f7c74dd3442d (patch)
tree387fbac8d8fc0ce0a57643cc5deb6ce560d6539b /src/test/java/com/juick/server
parentbe2c3b7dcbc006ce51cac2d63e23f64a8a775a1a (diff)
Refactor AppleClientSecretGenerator
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java9
1 files changed, 2 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 3edd4596..36483ce8 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -221,8 +221,6 @@ import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import org.tomitribe.auth.signatures.Base64;
-import org.tomitribe.churchkey.Key;
-import org.tomitribe.churchkey.Keys;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -2481,12 +2479,9 @@ public class ServerTests {
public void testAppleClientSecret()
throws NoSuchAlgorithmException, IOException, InvalidKeySpecException, NoSuchProviderException {
String secret = new String(clientSecretGenerator.getClientSecret().getBytes(), StandardCharsets.UTF_8);
- final Key key = Keys.decode(clientSecretGenerator.getPemData());
-
- // Get the public key
- final Key publicKey = key.getPublicKey();
+ final java.security.Key publicKey = clientSecretGenerator.getPublicKey();
- Jws<Claims> jwt = Jwts.parserBuilder().setSigningKey(publicKey.getKey()).build().parseClaimsJws(secret);
+ Jws<Claims> jwt = Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(secret);
assertThat(jwt.getHeader().get("kid"), is("keyid"));
assertThat(jwt.getHeader().get("alg"), is("ES256"));
Claims claims = jwt.getBody();