diff --git a/test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/README.md b/test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/README.md index 0821d3f1f4b..f2d5b40e9fd 100644 --- a/test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/README.md +++ b/test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/README.md @@ -14,9 +14,12 @@ This annotation has fields for a set of cluster types and number of brokers, as Arbitrary server properties can also be provided in the annotation: ```java -@ClusterTest(types = {Type.KRAFT}, securityProtocol = "PLAINTEXT", properties = { - @ClusterProperty(key = "inter.broker.protocol.version", value = "2.7-IV2"), - @ClusterProperty(key = "socket.send.buffer.bytes", value = "10240"), +@ClusterTest( + types = {Type.KRAFT}, + brokerSecurityProtocol = SecurityProtocol.PLAINTEXT, + properties = { + @ClusterProperty(key = "inter.broker.protocol.version", value = "2.7-IV2"), + @ClusterProperty(key = "socket.send.buffer.bytes", value = "10240"), }) void testSomething() { ... } ``` @@ -25,8 +28,8 @@ Multiple `@ClusterTest` annotations can be given to generate more than one test ```scala @ClusterTests(Array( - @ClusterTest(securityProtocol = "PLAINTEXT"), - @ClusterTest(securityProtocol = "SASL_PLAINTEXT") + @ClusterTest(brokerSecurityProtocol = SecurityProtocol.PLAINTEXT), + @ClusterTest(securityProtocol = SecurityProtocol.SASL_PLAINTEXT) )) def testSomething(): Unit = { ... } ``` @@ -45,18 +48,18 @@ produce any number of test configurations using a fluent builder style API. import java.util.Arrays; @ClusterTemplate("generateConfigs") -void testSomething() { ...} +void testSomething() { ... } static List generateConfigs() { ClusterConfig config1 = ClusterConfig.defaultClusterBuilder() .name("Generated Test 1") .serverProperties(props1) - .ibp("2.7-IV1") + .setMetadataVersion(MetadataVersion.IBP_2_7_IV1) .build(); ClusterConfig config2 = ClusterConfig.defaultClusterBuilder() .name("Generated Test 2") .serverProperties(props2) - .ibp("2.7-IV2") + .setMetadataVersion(MetadataVersion.IBP_2_7_IV2) .build(); ClusterConfig config3 = ClusterConfig.defaultClusterBuilder() .name("Generated Test 3")