aliehsaeedii commented on code in PR #24321:
URL: https://github.com/apache/kafka/pull/24321#discussion_r4644448049


##########
tools/src/test/java/org/apache/kafka/tools/streams/StreamsGroupCommandTest.java:
##########
@@ -342,6 +343,71 @@ public void testDescribeStreamsGroupsGetOffsets() throws 
Exception {
         service.close();
     }
 
+    @Test
+    public void testDescribeEmptyStreamsGroupShowsCommittedOffsets() throws 
Exception {
+        String groupId = "group1";
+        TopicPartition tp = new TopicPartition("topic1", 0);
+        // Use a dedicated admin mock so the listOffsets verification below 
only sees this test's calls.
+        Admin adminClient = mock(KafkaAdminClient.class);

Review Comment:
   Kept `mock(KafkaAdminClient.class)` to match the rest of this test class, 
where `ADMIN_CLIENT` and the other tests mock it the same way.



##########
tools/src/test/java/org/apache/kafka/tools/streams/StreamsGroupCommandTest.java:
##########
@@ -342,6 +343,71 @@ public void testDescribeStreamsGroupsGetOffsets() throws 
Exception {
         service.close();
     }
 
+    @Test
+    public void testDescribeEmptyStreamsGroupShowsCommittedOffsets() throws 
Exception {

Review Comment:
   Added `testDescribeStableStreamsGroupIncludesCommittedUnassignedPartitions`: 
a Stable group whose only member owns `topic1-0`, plus a committed offset for 
`topic1-1`. It checks that `listOffsets` is asked for both partitions and that 
both rows are returned, and it fails if the committed partitions are not added.



##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -1064,7 +1072,7 @@ private static void maybePrintEmptyGroupState(String 
group, GroupState state) {
             if (state == GroupState.DEAD) {
                 printError("Streams group '" + group + "' does not exist.", 
Optional.empty());
             } else if (state == GroupState.EMPTY) {
-                printError("Streams group '" + group + "' has no active 
members.", Optional.empty());
+                System.err.println("\nStreams group '" + group + "' has no 
active members.");

Review Comment:
   Fixed the javadoc. I'll also mention in the PR description that for 
`--describe --state` the notice moves from stdout to stderr and loses the 
`Error:` prefix.



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