Copilot commented on code in PR #21772:
URL: https://github.com/apache/kafka/pull/21772#discussion_r2940607881


##########
core/src/test/scala/integration/kafka/api/GroupCoordinatorIntegrationTest.scala:
##########
@@ -738,4 +913,18 @@ class GroupCoordinatorIntegrationTest(cluster: 
ClusterInstance) {
         assertEquals(s"Group $groupId not found.", e.getCause.getMessage)
     }
   }
+
+  private def assertDescribedDeadStreamsGroup(
+    groups: Map[String, 
KafkaFuture[org.apache.kafka.clients.admin.StreamsGroupDescription]],
+    groupId: String
+  ): Unit = {
+    try {
+      groups(groupId).get(10, TimeUnit.SECONDS)
+      fail(s"Group $groupId should not be found")
+    } catch {
+      case e: java.util.concurrent.ExecutionException =>
+        assertTrue(e.getCause.isInstanceOf[GroupIdNotFoundException])
+        assertEquals(s"Group $groupId not found.", e.getCause.getMessage)
+    }
+  }

Review Comment:
   `assertDescribedDeadStreamsGroup` is identical to `assertDescribedDeadGroup` 
in logic — the only difference is the type parameter of `KafkaFuture`. Since 
`KafkaFuture.get()` returns `Object` at the call site and the result is 
discarded, you could reuse `assertDescribedDeadGroup` by changing its signature 
to accept `Map[String, KafkaFuture[_]]`, or use a generic helper, avoiding the 
duplication.



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