mirror of https://github.com/apache/kafka.git
KAFKA-18486 Remove ReplicaManager#becomeLeaderOrFollower in `testVerificationErrorConversions` (#19923)
Remove ReplicaManager#becomeLeaderOrFollower in `testVerificationErrorConversionsTV1 ` and `testVerificationErrorConversionsTV2 `. Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
2e968560e0
commit
ab42f00bbe
|
@ -2649,6 +2649,7 @@ class ReplicaManagerTest {
|
|||
)
|
||||
)
|
||||
def testVerificationErrorConversionsTV2(error: Errors): Unit = {
|
||||
val localId = 1
|
||||
val tp0 = new TopicPartition(topic, 0)
|
||||
val producerId = 24L
|
||||
val producerEpoch = 0.toShort
|
||||
|
@ -2657,9 +2658,8 @@ 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))
|
||||
replicaManager.applyDelta(leaderDelta, imageFromTopics(leaderDelta.apply()))
|
||||
|
||||
val transactionalRecords = MemoryRecords.withTransactionalRecords(Compression.NONE, producerId, producerEpoch, sequence,
|
||||
new SimpleRecord("message".getBytes))
|
||||
|
@ -2699,6 +2699,7 @@ class ReplicaManagerTest {
|
|||
)
|
||||
)
|
||||
def testVerificationErrorConversionsTV1(error: Errors): Unit = {
|
||||
val localId = 1
|
||||
val tp0 = new TopicPartition(topic, 0)
|
||||
val producerId = 24L
|
||||
val producerEpoch = 0.toShort
|
||||
|
@ -2707,9 +2708,8 @@ 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))
|
||||
replicaManager.applyDelta(leaderDelta, imageFromTopics(leaderDelta.apply()))
|
||||
|
||||
val transactionalRecords = MemoryRecords.withTransactionalRecords(Compression.NONE, producerId, producerEpoch, sequence,
|
||||
new SimpleRecord("message".getBytes))
|
||||
|
|
Loading…
Reference in New Issue