From 0164355b258ee04f91e29f8f8a0dbfb6451d7551 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Fri, 25 Mar 2022 15:36:48 -0400 Subject: [PATCH] Fixes broken test due to unsupported EC using JDK-17 Signed-off-by: Darshit Chanpura --- .../auth/http/jwt/HTTPJwtAuthenticatorTest.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java b/src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java index 85ad573701..4a22f62525 100644 --- a/src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java +++ b/src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java @@ -30,7 +30,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Before; + import org.opensearch.common.settings.Settings; import org.apache.http.HttpHeaders; @@ -43,8 +43,6 @@ import org.opensearch.security.util.FakeRestRequest; import com.google.common.io.BaseEncoding; -import static org.junit.Assume.assumeFalse; - public class HTTPJwtAuthenticatorTest { final static byte[] secretKey = new byte[1024]; @@ -53,15 +51,6 @@ public class HTTPJwtAuthenticatorTest { new SecureRandom().nextBytes(secretKey); } - /* - This test fails during Java 17 build due to a known bug: https://bugs.openjdk.java.net/browse/JDK-8251547 - TODO: This method should be removed once a fix is implemented - */ - @Before - public void isJavaVersionBelow17(){ - assumeFalse(System.getProperty("java.version").startsWith("17")); - } - @Test public void testNoKey() throws Exception { @@ -485,7 +474,7 @@ public void testRS256() throws Exception { public void testES512() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); - keyGen.initialize(571); + keyGen.initialize(521); KeyPair pair = keyGen.generateKeyPair(); PrivateKey priv = pair.getPrivate(); PublicKey pub = pair.getPublic();