TaiJuWu commented on code in PR #17771:
URL: https://github.com/apache/kafka/pull/17771#discussion_r1849404649


##########
core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java:
##########
@@ -138,6 +139,36 @@ public void 
testNullStatusOnKraftCommandAlterClientMetrics() {
         assertEquals("Completed updating config for client-metric cm.", 
message);
     }
 
+    @ClusterTest
+    public void testAddConfigKeyValuesUsingCommand() throws Exception {
+
+        try (Admin client = cluster.admin()) {
+            NewTopic newTopic = new NewTopic("test-topic", 1, (short) 1);

Review Comment:
   Nit:  `String topic = "test-topic";` and replace all "test-topic" with 
`topic`.
   



##########
core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java:
##########
@@ -138,6 +139,36 @@ public void 
testNullStatusOnKraftCommandAlterClientMetrics() {
         assertEquals("Completed updating config for client-metric cm.", 
message);
     }
 
+    @ClusterTest
+    public void testAddConfigKeyValuesUsingCommand() throws Exception {
+
+        try (Admin client = cluster.admin()) {
+            NewTopic newTopic = new NewTopic("test-topic", 1, (short) 1);
+            client.createTopics(Collections.singleton(newTopic)).all().get();
+            cluster.waitForTopic("test-topic", 1);
+
+            Stream<String> command = Stream.concat(quorumArgs(), Stream.of(
+                    "--entity-type", "topics",
+                    "--entity-name", "test-topic",
+                    "--alter", "--add-config", 
"cleanup.policy=[delete,compact]"));
+
+            String message = captureStandardStream(false, run(command));
+            assertEquals("Completed updating config for topic test-topic.", 
message);
+
+            command = Stream.concat(quorumArgs(), Stream.of(
+                    "--entity-type", "topics",
+                    "--entity-name", "test-topic",
+                    "--describe"));
+
+            message = captureStandardStream(false, run(command));
+            assertTrue(message.contains("cleanup.policy=delete,compact"), 
"Config entry was not added correctly");
+
+            //Clean up by deleting topic
+            
client.deleteTopics(Collections.singleton("test-topic")).all().get();

Review Comment:
   We also need to make sure topic already deleted here.
   `cluster.waitForTopic("test-topic, 0);`



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