m1a2st commented on code in PR #16557:
URL: https://github.com/apache/kafka/pull/16557#discussion_r1677798849


##########
clients/src/test/java/org/apache/kafka/common/requests/FetchRequestTest.java:
##########
@@ -243,4 +244,45 @@ public void testPartitionDataEquals() {
             new FetchRequest.PartitionData(Uuid.randomUuid(), 300, 0L, 300, 
Optional.of(300)));
     }
 
+    @ParameterizedTest
+    @MethodSource("fetchVersions")
+    public void testFetchRequestNoCacheData(short version) {
+        boolean fetchRequestUsesTopicIds = version >= 13;
+        Uuid topicId = Uuid.randomUuid();
+        int partition = 0;
+        TopicIdPartition tp = new TopicIdPartition(topicId, partition, 
"topic");
+
+        Map<TopicPartition, FetchRequest.PartitionData> partitionData = 
Collections.singletonMap(tp.topicPartition(),
+                new FetchRequest.PartitionData(topicId, 0, 0, 0, 
Optional.empty()));
+        List<TopicIdPartition> toReplace = Collections.singletonList(tp);
+
+        FetchRequest fetchRequest = FetchRequest.Builder
+                .forReplica(version, 0, 1, 1, 1, partitionData)
+                .removed(Collections.emptyList())

Review Comment:
   I according to diffenet version to generate fetchRequest, that can avoid 
empty `forgottenTopicMap`



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to