Fixing failing JDK8 test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7be1f888 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7be1f888 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7be1f888 Branch: refs/heads/3.0.x-fixes Commit: 7be1f888e0e32a895a586a4a4a3de6efc54b7f5e Parents: 5b81488 Author: Colm O hEigeartaigh <[email protected]> Authored: Tue Oct 20 12:35:18 2015 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Tue Oct 20 14:00:45 2015 +0100 ---------------------------------------------------------------------- .../systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/7be1f888/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java ---------------------------------------------------------------------- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java index 01eecc9..90ad37d 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java @@ -29,7 +29,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import javax.crypto.Cipher; import javax.ws.rs.BadRequestException; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; @@ -41,7 +40,6 @@ import org.apache.cxf.rs.security.jose.jaxrs.JweClientResponseFilter; import org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor; import org.apache.cxf.rs.security.jose.jaxrs.JwsJsonClientResponseFilter; import org.apache.cxf.rs.security.jose.jaxrs.JwsJsonWriterInterceptor; -import org.apache.cxf.rs.security.jose.jwa.AlgorithmUtils; import org.apache.cxf.systest.jaxrs.security.Book; import org.apache.cxf.systest.jaxrs.security.SecurityTestUtil; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; @@ -63,17 +61,11 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase { public static void startServers() throws Exception { assertTrue("server did not launch correctly", launchServer(BookServerJwsJson.class, true)); - registerBouncyCastleIfNeeded(); + registerBouncyCastle(); } - private static void registerBouncyCastleIfNeeded() throws Exception { - try { - // Java 8 apparently has it - Cipher.getInstance(AlgorithmUtils.AES_GCM_ALGO_JAVA); - } catch (Throwable t) { - // Oracle Java 7 - Security.addProvider(new BouncyCastleProvider()); - } + private static void registerBouncyCastle() throws Exception { + Security.addProvider(new BouncyCastleProvider()); } @AfterClass public static void unregisterBouncyCastleIfNeeded() throws Exception { @@ -104,7 +96,6 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase { if (SKIP_AES_GCM_TESTS || !SecurityTestUtil.checkUnrestrictedPoliciesInstalled()) { return; } - String address = "https://localhost:" + PORT + "/jwejwsjsonhmac"; List<?> extraProviders = Arrays.asList(new JacksonJsonProvider(), new JweWriterInterceptor(),
