@SuppressWarnings("unchecked")
@Test
public void testStartWorkflow() throws Exception {

    StartWorkflow startWorkflow = new StartWorkflow();
    startWorkflow.setName("testWorkflow");
    startWorkflow.getInput().put("testInput", "${testId}");
    Map<String, String> taskToDomain = new HashMap<>();
    taskToDomain.put("*", "dev");
    startWorkflow.setTaskToDomain(taskToDomain);
    Action action = new Action();
    action.setAction(Type.start_workflow);
    action.setStart_workflow(startWorkflow);
    Object payload = objectMapper.readValue("{\"testId\":\"test_1\"}", Object.class);
    WorkflowDef workflowDef = new WorkflowDef();
    workflowDef.setName("testWorkflow");
    workflowDef.setVersion(1);
    when(workflowExecutor.startWorkflow(eq("testWorkflow"), eq(null), any(), any(), any(), eq("testEvent"), anyMap()))
            .thenReturn("workflow_1");
    Map<String, Object> output = actionProcessor.execute(action, payload, "testEvent", "testMessage");
    assertNotNull(output);
    assertEquals("workflow_1", output.get("workflowId"));
    ArgumentCaptor<String> correlationIdCaptor = ArgumentCaptor.forClass(String.class);
    ArgumentCaptor<Map> inputParamCaptor = ArgumentCaptor.forClass(Map.class);
    ArgumentCaptor<Map> taskToDomainCaptor = ArgumentCaptor.forClass(Map.class);
    verify(workflowExecutor).startWorkflow(eq("testWorkflow"), eq(null), correlationIdCaptor.capture(), inputParamCaptor.capture(), any(), eq("testEvent"), taskToDomainCaptor.capture());
    assertEquals("test_1", inputParamCaptor.getValue().get("testInput"));
    assertNull(correlationIdCaptor.getValue());
    assertEquals("testMessage", inputParamCaptor.getValue().get("conductor.event.messageId"));
    assertEquals("testEvent", inputParamCaptor.getValue().get("conductor.event.name"));
    assertEquals(taskToDomain, taskToDomainCaptor.getValue());
}