jolshan commented on code in PR #15454:
URL: https://github.com/apache/kafka/pull/15454#discussion_r1518416635


##########
core/src/test/scala/unit/kafka/server/AddPartitionsToTxnManagerTest.scala:
##########
@@ -98,19 +99,20 @@ class AddPartitionsToTxnManagerTest {
     when(partitionFor.apply(transactionalId1)).thenReturn(0)
     when(partitionFor.apply(transactionalId2)).thenReturn(1)
     when(partitionFor.apply(transactionalId3)).thenReturn(0)
-    
when(metadataCache.getTopicMetadata(Set(Topic.TRANSACTION_STATE_TOPIC_NAME), 
config.interBrokerListenerName))
-      .thenReturn(Seq(
-        new MetadataResponseData.MetadataResponseTopic()
-          .setName(Topic.TRANSACTION_STATE_TOPIC_NAME)
-          .setPartitions(List(
-            new MetadataResponseData.MetadataResponsePartition()
-              .setPartitionIndex(0)
-              .setLeaderId(0),
-            new MetadataResponseData.MetadataResponsePartition()
-              .setPartitionIndex(1)
-              .setLeaderId(1)
-          ).asJava)
-      ))
+    when(metadataCache.getPartitionInfo(Topic.TRANSACTION_STATE_TOPIC_NAME, 0))

Review Comment:
   i wonder if we could make a helper method for all of these.



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