Skip to content

Commit 9dc4fca

Browse files
authored
MINOR: update the test.api README.md (apache#17809)
Reviewers: Chia-Ping Tsai <[email protected]>
1 parent ed9cb08 commit 9dc4fca

File tree

1 file changed

+11
-8
lines changed
  • test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api

1 file changed

+11
-8
lines changed

test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ This annotation has fields for a set of cluster types and number of brokers, as
1414
Arbitrary server properties can also be provided in the annotation:
1515

1616
```java
17-
@ClusterTest(types = {Type.KRAFT}, securityProtocol = "PLAINTEXT", properties = {
18-
@ClusterProperty(key = "inter.broker.protocol.version", value = "2.7-IV2"),
19-
@ClusterProperty(key = "socket.send.buffer.bytes", value = "10240"),
17+
@ClusterTest(
18+
types = {Type.KRAFT},
19+
brokerSecurityProtocol = SecurityProtocol.PLAINTEXT,
20+
properties = {
21+
@ClusterProperty(key = "inter.broker.protocol.version", value = "2.7-IV2"),
22+
@ClusterProperty(key = "socket.send.buffer.bytes", value = "10240"),
2023
})
2124
void testSomething() { ... }
2225
```
@@ -25,8 +28,8 @@ Multiple `@ClusterTest` annotations can be given to generate more than one test
2528

2629
```scala
2730
@ClusterTests(Array(
28-
@ClusterTest(securityProtocol = "PLAINTEXT"),
29-
@ClusterTest(securityProtocol = "SASL_PLAINTEXT")
31+
@ClusterTest(brokerSecurityProtocol = SecurityProtocol.PLAINTEXT),
32+
@ClusterTest(securityProtocol = SecurityProtocol.SASL_PLAINTEXT)
3033
))
3134
def testSomething(): Unit = { ... }
3235
```
@@ -45,18 +48,18 @@ produce any number of test configurations using a fluent builder style API.
4548
import java.util.Arrays;
4649

4750
@ClusterTemplate("generateConfigs")
48-
void testSomething() { ...}
51+
void testSomething() { ... }
4952

5053
static List<ClusterConfig> generateConfigs() {
5154
ClusterConfig config1 = ClusterConfig.defaultClusterBuilder()
5255
.name("Generated Test 1")
5356
.serverProperties(props1)
54-
.ibp("2.7-IV1")
57+
.setMetadataVersion(MetadataVersion.IBP_2_7_IV1)
5558
.build();
5659
ClusterConfig config2 = ClusterConfig.defaultClusterBuilder()
5760
.name("Generated Test 2")
5861
.serverProperties(props2)
59-
.ibp("2.7-IV2")
62+
.setMetadataVersion(MetadataVersion.IBP_2_7_IV2)
6063
.build();
6164
ClusterConfig config3 = ClusterConfig.defaultClusterBuilder()
6265
.name("Generated Test 3")

0 commit comments

Comments
 (0)