IgnacioAcunaF commented on a change in pull request #10858:
URL: https://github.com/apache/kafka/pull/10858#discussion_r657421072



##########
File path: core/src/test/scala/unit/kafka/admin/ConsumerGroupServiceTest.scala
##########
@@ -62,6 +62,92 @@ class ConsumerGroupServiceTest {
     verify(admin, times(1)).listOffsets(offsetsArgMatcher, any())
   }
 
+  @Test
+  def testAdminRequestsForDescribeNegativeOffsets(): Unit = {
+    val args = Array("--bootstrap-server", "localhost:9092", "--group", group, 
"--describe", "--offsets")
+    val groupService = consumerGroupService(args)
+
+    val testTopicPartition0 = new TopicPartition("testTopic1", 0);
+    val testTopicPartition1 = new TopicPartition("testTopic1", 1);
+    val testTopicPartition2 = new TopicPartition("testTopic1", 2);
+    val testTopicPartition3 = new TopicPartition("testTopic2", 0);
+    val testTopicPartition4 = new TopicPartition("testTopic2", 1);
+    val testTopicPartition5 = new TopicPartition("testTopic2", 2);
+
+    val offsets = Map(
+      //testTopicPartition0 -> there is no offset information for an asssigned 
topic partition
+      testTopicPartition1 -> new OffsetAndMetadata(100), // regular 
information for a assigned partition
+      testTopicPartition2 -> null, //there is a null value for an asssigned 
topic partition
+      // testTopicPartition3 ->  there is no offset information for an 
unasssigned topic partition
+      testTopicPartition4 -> new OffsetAndMetadata(100), // regular 
information for a unassigned partition
+      testTopicPartition5 -> null, //there is a null value for an unasssigned 
topic partition
+    ).asJava

Review comment:
       Perfect, makes sense. Would do that.




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

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


Reply via email to