This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 695f3aa03c3 KAFKA-17936 Refactor SslTransportLayerTest#testDsaKeyPair 
to avoid skip test (#17682)
695f3aa03c3 is described below

commit 695f3aa03c380e7048fc5ef1104fbb0f6c468286
Author: xijiu <[email protected]>
AuthorDate: Wed Nov 6 10:42:08 2024 +0800

    KAFKA-17936 Refactor SslTransportLayerTest#testDsaKeyPair to avoid skip 
test (#17682)
    
    Reviewers: Chia-Ping Tsai <[email protected]>
---
 .../apache/kafka/common/network/SslTransportLayerTest.java   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java
 
b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java
index 94baffad0bf..8a5bf6fdad4 100644
--- 
a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java
+++ 
b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java
@@ -78,7 +78,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -150,6 +149,14 @@ public class SslTransportLayerTest {
         }
     }
 
+    private static class SslTransportLayerArgumentsForTLS2Provider extends 
SslTransportLayerArgumentsProvider {
+
+        @Override
+        public Stream<? extends Arguments> provideArguments(ExtensionContext 
context) throws Exception {
+            return super.provideArguments(context).filter(arg -> ((Args) 
arg.get()[0]).tlsProtocol.equals("TLSv1.2"));
+        }
+    }
+
     private NioEchoServer server;
     private Selector selector;
 
@@ -465,10 +472,9 @@ public class SslTransportLayerTest {
      * Tests key-pair created using DSA.
      */
     @ParameterizedTest
-    @ArgumentsSource(SslTransportLayerArgumentsProvider.class)
+    @ArgumentsSource(SslTransportLayerArgumentsForTLS2Provider.class)
     public void testDsaKeyPair(Args args) throws Exception {
         // DSA algorithms are not supported for TLSv1.3.
-        assumeTrue(args.tlsProtocol.equals("TLSv1.2"));
         args.serverCertStores = certBuilder(true, "server", 
args.useInlinePem).keyAlgorithm("DSA").build();
         args.clientCertStores = certBuilder(false, "client", 
args.useInlinePem).keyAlgorithm("DSA").build();
         args.sslServerConfigs = args.getTrustingConfig(args.serverCertStores, 
args.clientCertStores);

Reply via email to