rreddy-22 commented on code in PR #15150:
URL: https://github.com/apache/kafka/pull/15150#discussion_r1492719703


##########
tools/src/test/java/org/apache/kafka/tools/consumer/group/ListConsumerGroupTest.java:
##########
@@ -143,22 +312,134 @@ public void testListGroupCommand(String quorum) throws 
Exception {
             return out.get().contains("STATE") && 
out.get().contains(simpleGroup) && out.get().contains(GROUP);
         }, "Expected to find " + simpleGroup + ", " + GROUP + " and the 
header, but found " + out.get());
 
-        String[] cgcArgs3 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--state", "Stable"};
+        String[] cgcArgs3 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--type"};
         TestUtils.waitForCondition(() -> {
             out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
                 ConsumerGroupCommand.main(cgcArgs3);
                 return null;
             }));
+            return out.get().contains("TYPE") && !out.get().contains("STATE") 
&& out.get().contains(simpleGroup) && out.get().contains(GROUP);
+        }, "Expected to find " + simpleGroup + ", " + GROUP + " and the 
header, but found " + out.get());
+
+        String[] cgcArgs4 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--state", "--type"};
+        TestUtils.waitForCondition(() -> {
+            out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
+                ConsumerGroupCommand.main(cgcArgs4);
+                return null;
+            }));
+            return out.get().contains("TYPE") && out.get().contains("STATE") 
&& out.get().contains(simpleGroup) && out.get().contains(GROUP);
+        }, "Expected to find " + simpleGroup + ", " + GROUP + " and the 
header, but found " + out.get());
+
+        String[] cgcArgs5 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--state", "Stable"};
+        TestUtils.waitForCondition(() -> {
+            out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
+                ConsumerGroupCommand.main(cgcArgs5);
+                return null;
+            }));
             return out.get().contains("STATE") && out.get().contains(GROUP) && 
out.get().contains("Stable");
         }, "Expected to find " + GROUP + " in state Stable and the header, but 
found " + out.get());
 
-        String[] cgcArgs4 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--state", "stable"};
+        String[] cgcArgs6 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--state", "stable"};
         TestUtils.waitForCondition(() -> {
             out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
-                ConsumerGroupCommand.main(cgcArgs4);
+                ConsumerGroupCommand.main(cgcArgs6);
                 return null;
             }));
             return out.get().contains("STATE") && out.get().contains(GROUP) && 
out.get().contains("Stable");
         }, "Expected to find " + GROUP + " in state Stable and the header, but 
found " + out.get());
+
+        String[] cgcArgs7 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--type", "Classic"};
+        TestUtils.waitForCondition(() -> {
+            out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
+                ConsumerGroupCommand.main(cgcArgs7);
+                return null;
+            }));
+            return out.get().contains("TYPE") && out.get().contains("Classic") 
&& !out.get().contains("STATE") &&
+                out.get().contains(simpleGroup) && out.get().contains(GROUP);
+        }, "Expected to find " + GROUP + " and the header, but found " + 
out.get());
+
+        String[] cgcArgs8 = new String[]{"--bootstrap-server", 
bootstrapServers(listenerName()), "--list", "--type", "classic"};
+        TestUtils.waitForCondition(() -> {
+            out.set(kafka.utils.TestUtils.grabConsoleOutput(() -> {
+                ConsumerGroupCommand.main(cgcArgs8);
+                return null;
+            }));
+            return out.get().contains("TYPE") && out.get().contains("Classic") 
&& !out.get().contains("STATE") &&
+                out.get().contains(simpleGroup) && out.get().contains(GROUP);
+        }, "Expected to find " + GROUP + " and the header, but found " + 
out.get());

Review Comment:
   Thanks a lot! I'll take a look!



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