DeciderService { public List<Task> getTasksToBeScheduled(Workflow workflow, WorkflowTask taskToSchedule, int retryCount) { return getTasksToBeScheduled(workflow, taskToSchedule, retryCount, null); } @Inject  DeciderService(ParametersUtils parametersUtils, MetadataDAO metadataDAO,
                          ExternalPayloadStorageUtils externalPayloadStorageUtils,
                          @Named("TaskMappers") Map<String, TaskMapper> taskMappers, Configuration configuration); DeciderOutcome decide(Workflow workflow); List<Task> getTasksToBeScheduled(Workflow workflow,
                                            WorkflowTask taskToSchedule, int retryCount); List<Task> getTasksToBeScheduled(Workflow workflow,
                                            WorkflowTask taskToSchedule, int retryCount, String retriedTaskId);  }
@Test public void testGetTasksToBeScheduled() { WorkflowDef workflowDef = createLinearWorkflow(); Workflow workflow = new Workflow(); workflow.setWorkflowDefinition(workflowDef); workflow.setStatus(WorkflowStatus.RUNNING); WorkflowTask workflowTask1 = new WorkflowTask(); workflowTask1.setName("s1"); workflowTask1.setTaskReferenceName("s1"); workflowTask1.setType(TaskType.SIMPLE.name()); workflowTask1.setTaskDefinition(new TaskDef("s1")); List<Task> tasksToBeScheduled = deciderService.getTasksToBeScheduled(workflow, workflowTask1, 0, null); assertNotNull(tasksToBeScheduled); assertEquals(1, tasksToBeScheduled.size()); assertEquals("s1", tasksToBeScheduled.get(0).getReferenceTaskName()); WorkflowTask workflowTask2 = new WorkflowTask(); workflowTask2.setName("s2"); workflowTask2.setTaskReferenceName("s2"); workflowTask2.setType(TaskType.SIMPLE.name()); workflowTask2.setTaskDefinition(new TaskDef("s2")); tasksToBeScheduled = deciderService.getTasksToBeScheduled(workflow, workflowTask2, 0, null); assertNotNull(tasksToBeScheduled); assertEquals(1, tasksToBeScheduled.size()); assertEquals("s2", tasksToBeScheduled.get(0).getReferenceTaskName()); }