KAFKA-13187: Replace EasyMock / PowerMock with Mockito in DistributedHerderTest (#14102)

Reviewers: Chris Egerton <chrise@aiven.io>
This commit is contained in:
Yash Mayya 2023-08-10 21:47:30 +01:00 committed by GitHub
parent 0ee26640e5
commit f2ebd333e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1559 additions and 2462 deletions

View File

@ -415,7 +415,6 @@ subprojects {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) { if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
testsToExclude.addAll([ testsToExclude.addAll([
// connect tests // connect tests
"**/DistributedHerderTest.*",
"**/KafkaConfigBackingStoreTest.*", "**/KafkaConfigBackingStoreTest.*",
"**/KafkaBasedLogTest.*", "**/StandaloneHerderTest.*", "**/KafkaBasedLogTest.*", "**/StandaloneHerderTest.*",
"**/WorkerSinkTaskTest.*", "**/WorkerSinkTaskThreadedTest.*" "**/WorkerSinkTaskTest.*", "**/WorkerSinkTaskThreadedTest.*"

View File

@ -173,7 +173,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable {
// Visible for testing // Visible for testing
ExecutorService forwardRequestExecutor; ExecutorService forwardRequestExecutor;
private final ExecutorService herderExecutor; // Visible for testing
final ExecutorService herderExecutor;
// Visible for testing // Visible for testing
ExecutorService startAndStopExecutor; ExecutorService startAndStopExecutor;
private final WorkerGroupMember member; private final WorkerGroupMember member;
@ -274,7 +275,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable {
ConnectorClientConfigOverridePolicy connectorClientConfigOverridePolicy, ConnectorClientConfigOverridePolicy connectorClientConfigOverridePolicy,
List<String> restNamespace, List<String> restNamespace,
ExecutorService forwardRequestExecutor, ExecutorService forwardRequestExecutor,
AutoCloseable... uponShutdown) { // https://github.com/mockito/mockito/issues/2601 explains why we can't use varargs here
AutoCloseable[] uponShutdown) {
super(worker, workerId, kafkaClusterId, statusBackingStore, configBackingStore, connectorClientConfigOverridePolicy); super(worker, workerId, kafkaClusterId, statusBackingStore, configBackingStore, connectorClientConfigOverridePolicy);
this.time = time; this.time = time;