MINOR: Verify stopReplica if broker epoch not stale
Verify that ReplicaManager.stopReplica is called if the stop replica
request doesn't result in a stale broker epoch error.
Reviewers: Mickael Maison
@@ -3192,6 +3192,14 @@ class KafkaApisTest {
)
val stopReplicaResponse = capturedResponse.getValue
assertEquals(expectedError, stopReplicaResponse.error())
+ if (expectedError != Errors.STALE_BROKER_EPOCH) {
+ verify(replicaManager).stopReplicas(
+ ArgumentMatchers.eq(request.context.correlationId),
+ ArgumentMatchers.eq(controllerId),
+ ArgumentMatchers.eq(controllerEpoch),
+ ArgumentMatchers.eq(stopReplicaRequest.partitionStates().asScala)
+ )
+ }
}
@Test
