frankvicky commented on code in PR #19923: URL: https://github.com/apache/kafka/pull/19923#discussion_r2134984837
########## core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala: ########## @@ -2702,9 +2703,9 @@ class ReplicaManagerTest { val replicaManager = setUpReplicaManagerWithMockedAddPartitionsToTxnManager(addPartitionsToTxnManager, List(tp0)) try { - replicaManager.becomeLeaderOrFollower(1, - makeLeaderAndIsrRequest(topicIds(tp0.topic), tp0, Seq(0, 1), new LeaderAndIsr(1, List(0, 1).map(Int.box).asJava)), - (_, _) => ()) + val leaderDelta = topicsCreateDelta(localId, isStartIdLeader = true, partitions = List(0, 1), List.empty, topic, topicIds(topic)) + val leaderImage = imageFromTopics(leaderDelta.apply()) + replicaManager.applyDelta(leaderDelta, leaderImage) Review Comment: Could we inline `leaderImage`? ########## core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala: ########## @@ -2752,9 +2754,9 @@ class ReplicaManagerTest { val replicaManager = setUpReplicaManagerWithMockedAddPartitionsToTxnManager(addPartitionsToTxnManager, List(tp0)) try { - replicaManager.becomeLeaderOrFollower(1, - makeLeaderAndIsrRequest(topicIds(tp0.topic), tp0, Seq(0, 1), new LeaderAndIsr(1, List(0, 1).map(Int.box).asJava)), - (_, _) => ()) + val leaderDelta = topicsCreateDelta(localId, isStartIdLeader = true, partitions = List(0, 1), List.empty, topic, topicIds(topic)) + val leaderImage = imageFromTopics(leaderDelta.apply()) Review Comment: ditto -- 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