chia7712 commented on code in PR #16824:
URL: https://github.com/apache/kafka/pull/16824#discussion_r1726136316


##########
core/src/test/java/kafka/test/ClusterTestExtensionsTest.java:
##########
@@ -251,8 +251,7 @@ public void testClusterAliveBrokers(ClusterInstance 
clusterInstance) throws Exce
         Assertions.assertTrue(clusterInstance.brokers().containsKey(0));
     }
 
-
-    @ClusterTest(types = {Type.ZK, Type.CO_KRAFT, Type.KRAFT}, brokers = 4)
+    @ClusterTest(types = {Type.ZK, Type.CO_KRAFT, Type.KRAFT}, brokers = 4, 
listener = "TEST_LISTENER")

Review Comment:
   why we need this change?



##########
core/src/test/java/kafka/testkit/TestKitNodes.java:
##########
@@ -53,6 +57,8 @@ public static class Builder {
         private Map<Integer, Map<String, String>> perServerProperties = 
Collections.emptyMap();
         private BootstrapMetadata bootstrapMetadata = BootstrapMetadata.
             fromVersion(MetadataVersion.latestTesting(), "testkit");
+        private ListenerName listenerName = BROKER_LISTENER_NAME;
+        private SecurityProtocol securityProtocol = BROKER_SECURITY_PROTOCOL;

Review Comment:
   we don't need this default value as in IT the default value is defined by 
`ClusterTest`. We can add null check for `securityProtocol` instead



##########
core/src/test/java/kafka/test/junit/RaftClusterInvocationContext.java:
##########
@@ -112,10 +112,13 @@ public static class RaftClusterInstance implements 
ClusterInstance {
         private EmbeddedZookeeper embeddedZookeeper;
         private KafkaClusterTestKit clusterTestKit;
         private final boolean isCombined;
+        private final ListenerName listenerName;
 
         RaftClusterInstance(ClusterConfig clusterConfig, boolean isCombined) {
             this.clusterConfig = clusterConfig;
             this.isCombined = isCombined;
+            this.listenerName = 
clusterConfig.listenerName().map(ListenerName::normalised)
+                    .orElse(TestKitNodes.BROKER_LISTENER_NAME);

Review Comment:
   Could we align the behavior to zk? 
   ```java
   clusterConfig.listenerName().map(ListenerName::normalised)
                       .orElseGet(() -> 
ListenerName.forSecurityProtocol(securityProtocol()));
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to