Browse Source

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

Reviewers: Chris Egerton <chrise@aiven.io>
pull/14095/head
Yash Mayya 1 year ago committed by GitHub
parent
commit
f2ebd333e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      build.gradle
  2. 6
      connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java
  3. 4010
      connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java

1
build.gradle

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

6
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java

@ -173,7 +173,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable { @@ -173,7 +173,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable {
// Visible for testing
ExecutorService forwardRequestExecutor;
private final ExecutorService herderExecutor;
// Visible for testing
final ExecutorService herderExecutor;
// Visible for testing
ExecutorService startAndStopExecutor;
private final WorkerGroupMember member;
@ -274,7 +275,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable { @@ -274,7 +275,8 @@ public class DistributedHerder extends AbstractHerder implements Runnable {
ConnectorClientConfigOverridePolicy connectorClientConfigOverridePolicy,
List<String> restNamespace,
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);
this.time = time;

4010
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save