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


##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -139,28 +151,38 @@ public Map<String, String> nameTags() {
         return tags;
     }
 
-    public ClusterConfig copyOf() {
-        ClusterConfig copy = new ClusterConfig(type, brokers, controllers, 
name, autoStart, securityProtocol, listenerName, trustStoreFile, 
metadataVersion);
-        copy.serverProperties.putAll(serverProperties);
-        copy.producerProperties.putAll(producerProperties);
-        copy.consumerProperties.putAll(consumerProperties);
-        copy.saslServerProperties.putAll(saslServerProperties);
-        copy.saslClientProperties.putAll(saslClientProperties);
-        perBrokerOverrideProperties.forEach((brokerId, props) -> {
-            Properties propsCopy = new Properties();
-            propsCopy.putAll(props);
-            copy.perBrokerOverrideProperties.put(brokerId, propsCopy);
-        });
-        return copy;
+    public static Builder defaultBuilder() {
+        return new Builder()
+                .setType(Type.ZK)
+                .setBrokers(1)
+                .setControllers(1)
+                .setAutoStart(true)
+                .setSecurityProtocol(SecurityProtocol.PLAINTEXT)
+                .setMetadataVersion(MetadataVersion.latestTesting());
     }
 
-    public static Builder defaultClusterBuilder() {
-        return new Builder(Type.ZK, 1, 1, true, SecurityProtocol.PLAINTEXT, 
MetadataVersion.latestTesting());
+    public static Builder builder() {
+        return new Builder();
     }
 
-    public static Builder clusterBuilder(Type type, int brokers, int 
controllers, boolean autoStart,
-                                         SecurityProtocol securityProtocol, 
MetadataVersion metadataVersion) {
-        return new Builder(type, brokers, controllers, autoStart, 
securityProtocol, metadataVersion);
+    public static Builder builder(ClusterConfig clusterConfig) {

Review Comment:
   > Maybe we should directly remove the helper method here
   
   It seems to me this helper could be useful to the tests which have to update 
a part of configs. Hence, all we need to do is add test to make sure the clone 
works well :)



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to