Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
Evaluator: Replace ScheduledThreadPoolExecutor use with ExecutorService
Change-Id: Iea3d2ce15c8381bf6ede36492e1493e2b69ddd98
diff --git a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
index 037d11d..3cec08a 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
@@ -31,8 +31,8 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.ObjectId;
@@ -48,7 +48,7 @@
private static final Logger log = LoggerFactory.getLogger(Evaluator.class);
private static final ThreadLocal<String> uploadRepositoryPath = new ThreadLocal<String>() {};
- private final ScheduledThreadPoolExecutor executor;
+ private final ExecutorService executor;
private final EvaluationTask.Factory evaluationTaskFactory;
private final GitRepositoryManager repoManager;
private final Map<String, Long> timestamps;
@@ -59,7 +59,7 @@
@Inject
Evaluator(
- @EvaluatorExecutor ScheduledThreadPoolExecutor executor,
+ @EvaluatorExecutor ExecutorService executor,
EvaluationTask.Factory evaluationTaskFactory,
GitRepositoryManager repoManager,
EvaluatorConfig config,
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
index b503259..7834c17 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
@@ -29,7 +29,7 @@
import java.io.File;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ExecutorService;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.Repository;
@@ -49,7 +49,7 @@
@Mock private GitRepositoryManager repoManager;
@Mock private Repository repository;
@Mock private Repository repositoryOther;
- @Mock private ScheduledThreadPoolExecutor executor;
+ @Mock private ExecutorService executor;
@Mock private EvaluatorConfig config;
@Mock private Config gerritConfig;