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


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -69,7 +69,6 @@ import com.yammer.metrics.core.Gauge
 import kafka.log.remote.RemoteLogManager
 import org.apache.kafka.common.config.AbstractConfig
 import org.apache.kafka.common.internals.Topic
-import 
org.apache.kafka.common.message.AddPartitionsToTxnRequestData.{AddPartitionsToTxnTopic,
 AddPartitionsToTxnTopicCollection, AddPartitionsToTxnTransaction}

Review Comment:
   For our `setUpReplicaManagerWithMockedAddPartitionsToTxnManager` we can 
remove the lines of code that mocks the flow for getting transaction state 
partitions.
   
       val metadataResponseTopic = Seq(new MetadataResponseTopic()
         .setName(Topic.TRANSACTION_STATE_TOPIC_NAME)
         .setPartitions(Seq(
           new MetadataResponsePartition()
             .setPartitionIndex(0)
             .setLeaderId(0)).asJava))
       transactionalTopicPartitions.foreach(tp => 
when(metadataCache.contains(tp)).thenReturn(true))
       
when(metadataCache.getTopicMetadata(Set(Topic.TRANSACTION_STATE_TOPIC_NAME), 
config.interBrokerListenerName)).thenReturn(metadataResponseTopic)
       when(metadataCache.getAliveBrokerNode(0, 
config.interBrokerListenerName)).thenReturn(Some(node))
       when(metadataCache.getAliveBrokerNode(1, 
config.interBrokerListenerName)).thenReturn(None)
       
    I think the same code exists for `setupReplicaManagerWithMockedPurgatories` 
  



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