Search in sources :

Example 21 with TaskNode

use of com.dangdang.ddframe.job.cloud.scheduler.fixture.TaskNode in project elastic-job by dangdangdotcom.

the class FacadeServiceTest method assertRecordFailoverTaskWhenIsFailoverDisabled.

@Test
public void assertRecordFailoverTaskWhenIsFailoverDisabled() {
    TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build();
    when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createOtherCloudJobConfiguration("test_job")));
    facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue()));
    verify(failoverService, times(0)).add(TaskContext.from(taskNode.getTaskNodeValue()));
}
Also used : TaskNode(com.dangdang.ddframe.job.cloud.scheduler.fixture.TaskNode) Test(org.junit.Test)

Aggregations

TaskNode (com.dangdang.ddframe.job.cloud.scheduler.fixture.TaskNode)21 Test (org.junit.Test)21 TaskContext (com.dangdang.ddframe.job.context.TaskContext)2