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


##########
clients/src/test/java/org/apache/kafka/common/requests/FetchRequestTest.java:
##########
@@ -243,4 +245,44 @@ public void testPartitionDataEquals() {
             new FetchRequest.PartitionData(Uuid.randomUuid(), 300, 0L, 300, 
Optional.of(300)));
     }
 
+    @Test
+    public void testFetchRequestNoCacheData() {
+        short 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())
+                .replaced(toReplace)
+                .metadata(FetchMetadata.newIncremental(123)).build(version);
+        
+        HashMap<Uuid, String> topicNames = new HashMap<>();
+        topicNames.put(topicId, tp.topic());
+        
+        List<TopicIdPartition> requestsWithTopicsName = 
fetchRequest.forgottenTopics(topicNames);

Review Comment:
   `Collections.singletonMap(topicId, tp.topic())`



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