dajac commented on code in PR #17651:
URL: https://github.com/apache/kafka/pull/17651#discussion_r1827403390


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -195,14 +196,23 @@ public void testConsumerHeartbeatRequestValidation() {
                 .setRebalanceTimeoutMs(5000)));
         assertEquals("TopicPartitions must be empty when (re-)joining.", 
ex.getMessage());
 
-        // SubscribedTopicNames must be present and empty in the first request 
(epoch == 0).
+        // SubscribedTopicNames can be present and non-empty in the first 
request (epoch == 0).
         ex = assertThrows(InvalidRequestException.class, () -> 
context.consumerGroupHeartbeat(
             new ConsumerGroupHeartbeatRequestData()
                 .setGroupId("foo")
                 .setMemberEpoch(0)
                 .setRebalanceTimeoutMs(5000)
                 .setTopicPartitions(Collections.emptyList())));
-        assertEquals("SubscribedTopicNames must be set in first request.", 
ex.getMessage());
+        assertEquals("SubscribedTopicNames or SubscribedTopicRegex must be set 
in first request.", ex.getMessage());
+
+        // SubscribedTopicRegex can be present and non-empty in the first 
request (epoch == 0).
+        ex = assertThrows(InvalidRequestException.class, () -> 
context.consumerGroupHeartbeat(
+            new ConsumerGroupHeartbeatRequestData()
+                .setGroupId("foo")
+                .setMemberEpoch(0)
+                .setRebalanceTimeoutMs(5000)
+                .setTopicPartitions(Collections.emptyList())));
+        assertEquals("SubscribedTopicNames or SubscribedTopicRegex must be set 
in first request.", ex.getMessage());

Review Comment:
   Indeed. Removed it.



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