diff --git a/core/src/main/java/com/netflix/conductor/core/events/SimpleActionProcessor.java b/core/src/main/java/com/netflix/conductor/core/events/SimpleActionProcessor.java index 46fcd545d..84e723439 100644 --- a/core/src/main/java/com/netflix/conductor/core/events/SimpleActionProcessor.java +++ b/core/src/main/java/com/netflix/conductor/core/events/SimpleActionProcessor.java @@ -19,6 +19,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import com.netflix.conductor.common.metadata.events.EventHandler.Action; import com.netflix.conductor.common.metadata.events.EventHandler.StartWorkflow; @@ -32,7 +33,6 @@ import com.netflix.conductor.metrics.Monitors; import com.netflix.conductor.model.TaskModel; import com.netflix.conductor.model.WorkflowModel; -import org.springframework.util.CollectionUtils; /** * Action Processor subscribes to the Event Actions queue and processes the actions (e.g. start @@ -198,17 +198,18 @@ private Map startWorkflow( Map paramsMap = new HashMap<>(); // extracting taskToDomain map from the event payload - paramsMap.put("taskToDomain","${taskToDomain}"); + paramsMap.put("taskToDomain", "${taskToDomain}"); Optional.ofNullable(params.getCorrelationId()) .ifPresent(value -> paramsMap.put("correlationId", value)); Map replaced = parametersUtils.replace(paramsMap, payload); - // if taskToDomain is absent from event handler definition, and taskDomain Map is passed as a part of payload + // if taskToDomain is absent from event handler definition, and taskDomain Map is passed + // as a part of payload // then assign payload taskToDomain map to the new workflow instance - final Map taskToDomain = params.getTaskToDomain() != null ? - params.getTaskToDomain() : - (Map) replaced.get("taskToDomain"); - + final Map taskToDomain = + params.getTaskToDomain() != null + ? params.getTaskToDomain() + : (Map) replaced.get("taskToDomain"); workflowInput.put("conductor.event.messageId", messageId); workflowInput.put("conductor.event.name", event); diff --git a/core/src/test/java/com/netflix/conductor/core/events/TestSimpleActionProcessor.java b/core/src/test/java/com/netflix/conductor/core/events/TestSimpleActionProcessor.java index afda4c769..3e57142b7 100644 --- a/core/src/test/java/com/netflix/conductor/core/events/TestSimpleActionProcessor.java +++ b/core/src/test/java/com/netflix/conductor/core/events/TestSimpleActionProcessor.java @@ -126,7 +126,8 @@ public void testStartWorkflow_taskDomain() throws Exception { Object payload = objectMapper.readValue( - "{ \"testId\": \"test_1\", \"taskToDomain\":{\"testTask\":\"testDomain\"} }", Object.class); + "{ \"testId\": \"test_1\", \"taskToDomain\":{\"testTask\":\"testDomain\"} }", + Object.class); Map taskToDomain = new HashMap<>(); taskToDomain.put("testTask", "testDomain"); @@ -156,7 +157,6 @@ public void testStartWorkflow_taskDomain() throws Exception { assertEquals("testEvent", capturedValue.getWorkflowInput().get("conductor.event.name")); } - @SuppressWarnings({"unchecked", "rawtypes"}) @Test public void testStartWorkflow() throws Exception {