Skip to content

Commit

Permalink
cp: hotfix for optional params
Browse files Browse the repository at this point in the history
  • Loading branch information
lepsalex committed Apr 13, 2020
1 parent 6c98b3d commit 55c998e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String, Object> workflowParams;
private Map<String, Object> workflowParams = new HashMap<String, Object>();
private WorkflowEngineParams workflowEngineParams = new WorkflowEngineParams();

private WorkflowEngineParams workflowEngineParams;
private Map<String, Object> workflowType;
private String[] workflowTypeVersion;
private Map<String, Object> tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 55c998e

Please sign in to comment.