SystemTaskWorkerCoordinator { @VisibleForTesting boolean isAsyncSystemTask(String queue) { String taskType = QueueUtils.getTaskType(queue); if (StringUtils.isNotBlank(taskType)) { WorkflowSystemTask task = taskNameWorkflowTaskMapping.get(taskType); return Objects.nonNull(task) && task.isAsync(); } return false; } @Inject  SystemTaskWorkerCoordinator(QueueDAO queueDAO, WorkflowExecutor workflowExecutor, Configuration config, ExecutionService executionService);  static Map<String, WorkflowSystemTask> taskNameWorkflowTaskMapping; }
@Test public void isSystemTask() { createTaskMapping(); SystemTaskWorkerCoordinator systemTaskWorkerCoordinator = new SystemTaskWorkerCoordinator(queueDAO, workflowExecutor, mock(Configuration.class), executionService); assertTrue(systemTaskWorkerCoordinator.isAsyncSystemTask(TEST_QUEUE + ISOLATION_CONSTANT)); }
@Test public void isSystemTaskNotPresent() { createTaskMapping(); SystemTaskWorkerCoordinator systemTaskWorkerCoordinator = new SystemTaskWorkerCoordinator(queueDAO, workflowExecutor, mock(Configuration.class), executionService); assertFalse(systemTaskWorkerCoordinator.isAsyncSystemTask(null)); }