private RunningExecutionsUpdaterThread getRunningExecutionsUpdaterThread() { return new RunningExecutionsUpdaterThread(new RunningExecutionsUpdater( this.updaterStage, this.alertHolder, this.commonMetrics, this.apiGateway, this.runningExecutions, this.executionFinalizer, this.execLoader), this.runningExecutions); }
private ExecutorManager createExecutorManager() throws ExecutorManagerException { // TODO rename this test to ExecutorManagerIntegrationTest & create separate unit tests as well? final ActiveExecutors activeExecutors = new ActiveExecutors(this.loader); final ExecutionFinalizer executionFinalizer = new ExecutionFinalizer(this.loader, this.updaterStage, this.alertHolder, this.runningExecutions); final RunningExecutionsUpdaterThread updaterThread = new RunningExecutionsUpdaterThread( new RunningExecutionsUpdater( this.updaterStage, this.alertHolder, this.commonMetrics, this.apiGateway, this.runningExecutions, executionFinalizer, this.loader), this.runningExecutions); updaterThread.waitTimeIdleMs = 0; updaterThread.waitTimeMs = 0; final ExecutorManager executorManager = new ExecutorManager(this.props, this.loader, this.commonMetrics, this.apiGateway, this.runningExecutions, activeExecutors, this.updaterStage, executionFinalizer, updaterThread); executorManager.setSleepAfterDispatchFailure(Duration.ZERO); executorManager.initialize(); return executorManager; }
@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); this.execution = new ExecutableFlow(); this.execution.setExecutionId(EXECUTION_ID_77); this.activeExecutor = new Executor(1, "activeExecutor-1", 9999, true); this.runningExecutions = new RunningExecutions(); this.runningExecutions.get().put(EXECUTION_ID_77, new Pair<>( new ExecutionReference(EXECUTION_ID_77, this.activeExecutor), this.execution)); this.updater = new RunningExecutionsUpdater(this.updaterStage, this.alerterHolder, this.commonMetrics, this.apiGateway, this.runningExecutions, this.executionFinalizer, this.executorLoader); when(this.alerterHolder.get("email")).thenReturn(this.mailAlerter); }