diff --git a/src/main/java/org/icgc/argo/workflow_management/controller/model/RunsRequest.java b/src/main/java/org/icgc/argo/workflow_management/controller/model/RunsRequest.java index 9ac20ae..6025bff 100644 --- a/src/main/java/org/icgc/argo/workflow_management/controller/model/RunsRequest.java +++ b/src/main/java/org/icgc/argo/workflow_management/controller/model/RunsRequest.java @@ -3,6 +3,8 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategy; import com.fasterxml.jackson.databind.annotation.JsonNaming; import io.swagger.annotations.ApiModel; + +import java.util.HashMap; import java.util.Map; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -19,10 +21,9 @@ public class RunsRequest { @NotBlank(message = "workflow_url is a required field!") private String workflowUrl; - @NotNull(message = "workflow_params is a required field!") - private Map workflowParams; + private Map workflowParams = new HashMap(); + private WorkflowEngineParams workflowEngineParams = new WorkflowEngineParams(); - private WorkflowEngineParams workflowEngineParams; private Map workflowType; private String[] workflowTypeVersion; private Map tags; diff --git a/src/test/java/org/icgc/argo/workflow_management/ErrorHandlingTests.java b/src/test/java/org/icgc/argo/workflow_management/ErrorHandlingTests.java index d3afce6..14798f2 100644 --- a/src/test/java/org/icgc/argo/workflow_management/ErrorHandlingTests.java +++ b/src/test/java/org/icgc/argo/workflow_management/ErrorHandlingTests.java @@ -176,9 +176,7 @@ public void testInvalidRunsRequest() { .jsonPath("$.status_code") .isEqualTo(BAD_REQUEST.value()) .jsonPath("$.msg") - .value(containsString("workflow_url is a required field!")) - .jsonPath("$.msg") - .value(containsString("workflow_params is a required field!")); + .value(containsString("workflow_url is a required field!")); // Assert a request with only the workflowParams field defined returns a BAD_REQUEST val reqWorkflowUrlUndefined = new RunsRequest();