IsolatedTaskQueueProducer { @VisibleForTesting void addTaskQueues() { Set<TaskDef> isolationTaskDefs = getIsolationExecutionNameSpaces(); logger.debug("Retrieved queues {}", isolationTaskDefs); Set<String> taskTypes = SystemTaskWorkerCoordinator.taskNameWorkflowTaskMapping.keySet(); for (TaskDef isolatedTaskDef : isolationTaskDefs) { for (String taskType : taskTypes) { String taskQueue = QueueUtils.getQueueName(taskType, null, isolatedTaskDef.getExecutionNameSpace(), isolatedTaskDef.getIsolationGroupId()); logger.debug("Adding taskQueue:'{}' to system task worker coordinator", taskQueue); SystemTaskWorkerCoordinator.queue.add(taskQueue); } } } @Inject  IsolatedTaskQueueProducer(MetadataService metadataService, Configuration config);   }
@Test public void addTaskQueuesAddsElementToQueue() throws InterruptedException { SystemTaskWorkerCoordinator.taskNameWorkflowTaskMapping.put("HTTP", Mockito.mock(WorkflowSystemTask.class)); MetadataService metadataService = Mockito.mock(MetadataService.class); IsolatedTaskQueueProducer isolatedTaskQueueProducer = new IsolatedTaskQueueProducer(metadataService, Mockito.mock(Configuration.class)); TaskDef taskDef = new TaskDef(); taskDef.setIsolationGroupId("isolated"); Mockito.when(metadataService.getTaskDefs()).thenReturn(Arrays.asList(taskDef)); isolatedTaskQueueProducer.addTaskQueues(); Assert.assertFalse(SystemTaskWorkerCoordinator.queue.isEmpty()); }