ijuma commented on a change in pull request #9874: URL: https://github.com/apache/kafka/pull/9874#discussion_r556662966
########## File path: clients/src/test/java/org/apache/kafka/common/security/ssl/SslFactoryTest.java ########## @@ -47,45 +46,38 @@ import org.apache.kafka.common.utils.Utils; import org.apache.kafka.test.TestSslUtils; import org.apache.kafka.common.network.Mode; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.security.Security; import java.util.Properties; +import java.util.stream.Stream; -@RunWith(value = Parameterized.class) public class SslFactoryTest { - private final String tlsProtocol; - - @Parameterized.Parameters(name = "tlsProtocol={0}") - public static Collection<Object[]> data() { - List<Object[]> values = new ArrayList<>(); - values.add(new Object[] {"TLSv1.2"}); - if (Java.IS_JAVA11_COMPATIBLE) { - values.add(new Object[] {"TLSv1.3"}); - } - return values; - } - - public SslFactoryTest(String tlsProtocol) { - this.tlsProtocol = tlsProtocol; + private static Stream<Arguments> parameters() { Review comment: Yeah, we can do that. Subclassing is a bit less flexible once you want more than one parameter or if the number of values per parameter is large, but it will probably be a few years before we have another TLS version. By then, JUnit 5 should hopefully support class parameterized. :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org