chia7712 commented on code in PR #21196:
URL: https://github.com/apache/kafka/pull/21196#discussion_r2638562381
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/PlaintextConsumerCommitTest.java:
##########
@@ -178,6 +178,31 @@ private void testCommitMetadata(GroupProtocol
groupProtocol) throws InterruptedE
}
}
+ @ClusterTest
+ public void testClassicConsumerNoCommittedOffsets() {
+ testNoCommittedOffsets(GroupProtocol.CLASSIC);
+ }
+
+ @ClusterTest
+ public void testAsyncConsumerNoCommittedOffsets() {
+ testNoCommittedOffsets(GroupProtocol.CONSUMER);
+ }
+
+ private void testNoCommittedOffsets(GroupProtocol groupProtocol) {
+ try (var consumer = createConsumer(groupProtocol, true)) {
+ consumer.assign(List.of(tp));
+ // commit for one partition
+ var metadata = new OffsetAndMetadata(5, Optional.of(15), "foo");
+ consumer.commitSync(Map.of(tp, metadata));
+
+ // fetch offset for two partitions
+ var committed = consumer.committed(Set.of(tp, tp1));
Review Comment:
Could you try a non-existent partition? It should return nullify as well.
--
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]