From 6e5e857a967579f3050f4cbb6ab07da2cd9b0e49 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 21 May 2020 12:45:15 +0300 Subject: Fix build with new http-signatures-java library * cleanup deprecation warnings --- src/test/java/com/juick/server/tests/ServerTests.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/test/java/com/juick') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index aad85884..43a0dc7b 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -429,8 +429,6 @@ public class ServerTests { messagesService.deleteMessage(user.getUid(), mid4); } - public ExpectedException exception = ExpectedException.none(); - @Test public void likeTypeStatsTests() { User dsdss = userService.createUser("dsdss", "secret").orElseThrow(IllegalStateException::new); @@ -1929,7 +1927,7 @@ public class ServerTests { restServiceServer.expect(times(3), requestTo(testuserkeyUri)) .andRespond(withSuccess(testuserResponseString, MediaType.APPLICATION_JSON)); Person testuser = (Person) signatureManager.getContext(testuserUri).get(); - Assert.assertThat(testuser.getPublicKey().getPublicKeyPem(), is(testKeystoreManager.getPublicKeyPem())); + assertThat(testuser.getPublicKey().getPublicKeyPem(), is(testKeystoreManager.getPublicKeyPem())); Instant now2 = Instant.now(); String testRequestDate = DateFormattersHolder.getHttpDateFormatter().format(now2); String inboxUri = "/api/inbox"; @@ -2390,12 +2388,12 @@ public class ServerTests { Jws jwt = Jwts.parserBuilder() .setSigningKey(publicKeyGenerated).build() .parseClaimsJws(secret); - Assert.assertThat(jwt.getHeader().get("kid"), is("keyid")); - Assert.assertThat(jwt.getHeader().get("alg"), is("ES256")); + assertThat(jwt.getHeader().get("kid"), is("keyid")); + assertThat(jwt.getHeader().get("alg"), is("ES256")); Claims claims = jwt.getBody(); - Assert.assertThat(claims.get("iss"), is("teamid")); - Assert.assertThat(claims.get("sub"), is("com.example.app")); - Assert.assertThat(claims.get("aud"), is("https://appleid.apple.com")); + assertThat(claims.get("iss"), is("teamid")); + assertThat(claims.get("sub"), is("com.example.app")); + assertThat(claims.get("aud"), is("https://appleid.apple.com")); } @Test -- cgit v1.2.3