public void startScheduling() {
for (ChainingCallback chainingCallback : chainingCallbacks) {
ListenableScheduledFuture<CeWorker.Result> future = executorService.schedule(chainingCallback.worker, delayBetweenEnabledTasks, timeUnit);
- addCallback(future, chainingCallback, executorService);
+ addCallback(future, chainingCallback);
}
}
private void addCallback() {
if (workerFuture != null && keepRunning()) {
- Futures.addCallback(workerFuture, this, executorService);
+ Futures.addCallback(workerFuture, this);
}
}
for (int i = 0; i < workerCount; i++) {
verify(processingExecutorService).schedule(workers[i], ceConfiguration.getQueuePollingDelay(), MILLISECONDS);
}
- verify(listenableScheduledFuture, times(workerCount)).addListener(any(Runnable.class), eq(processingExecutorService));
+ verify(listenableScheduledFuture, times(workerCount)).addListener(any(Runnable.class), eq(MoreExecutors.directExecutor()));
for (int i = 0; i < workerCount; i++) {
verify(ceWorkerFactory).create(i);
}