FrankYang0529 commented on code in PR #17150:
URL: https://github.com/apache/kafka/pull/17150#discussion_r1795681697


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessorTest.java:
##########
@@ -231,6 +231,130 @@ public void testSubscriptionChangeEvent() {
         verify(membershipManager, never()).onConsumerPoll();
     }
 
+    @Test
+    public void testSyncCommitEventWithOffsets() {
+        final long deadlineMs = 12345;
+        TopicPartition tp = new TopicPartition("topic", 0);
+        Map<TopicPartition, OffsetAndMetadata> offsets = 
Collections.singletonMap(tp, new OffsetAndMetadata(10, Optional.of(1), null));
+        SyncCommitEvent event = new SyncCommitEvent(Optional.of(offsets), 
deadlineMs);
+
+        setupProcessor(true);
+        doReturn(true).when(metadata).updateLastSeenEpochIfNewer(tp, 1);
+        
doReturn(CompletableFuture.completedFuture(null)).when(commitRequestManager).commitSync(offsets,
 deadlineMs);

Review Comment:
   The future from `CommitRequestManager#commitSync` is 
`CompletableFuture<Void>`, so it's ok to use `null`. 
   
   The `event.future.get()` can get expected result is because it gets 
`offsets` here 
https://github.com/apache/kafka/pull/17150/files#diff-583aa43613edc803471d93ed124d1cbed165768ed674c747784ab068e0ed7518R233.



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