showuon commented on code in PR #12748:
URL: https://github.com/apache/kafka/pull/12748#discussion_r1018908171


##########
clients/src/test/java/org/apache/kafka/clients/consumer/CooperativeStickyAssignorTest.java:
##########
@@ -78,6 +80,26 @@ public void testDecodeGeneration() {
         assertFalse(((CooperativeStickyAssignor) 
assignor).memberData(subscription).generation.isPresent());
     }
 
+    @Test
+    public void 
testCooperativeStickyAssignorHonorSubscriptionUserdataIfNoGenerationIdInField() 
{
+        Map<String, Integer> partitionsPerTopic = new HashMap<>();
+        partitionsPerTopic.put(topic, 2);
+        int higherGenerationId = 2;
+        int lowerGenerationId = 1;
+
+        assignor.onAssignment(new 
ConsumerPartitionAssignor.Assignment(partitions(tp1)), new 
ConsumerGroupMetadata(groupId, higherGenerationId, consumer1, 
Optional.empty()));
+        ByteBuffer userDataWithHigherGenerationId = 
assignor.subscriptionUserData(new HashSet<>(topics(topic)));

Review Comment:
   You're right. Change to test `memberDataFromSubscription`



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