diff options
author | Oren Kleks <orenkle@amdocs.com> | 2018-07-26 10:25:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-26 10:25:00 +0000 |
commit | 359c9faa1d058adcb4f9b0cef8daeb2bc854197e (patch) | |
tree | cb3b4e16541db2049dc48e4e59c7054acb5843ce /workflow-designer-be/src/test/java | |
parent | b4e10916730183985179c4aa81a94d459ac3369b (diff) | |
parent | 3a530ec00f047e306eb53961ad71ca67f545773c (diff) |
Merge "Validator init binder fix"
Diffstat (limited to 'workflow-designer-be/src/test/java')
-rw-r--r-- | workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/WorkflowControllerTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/WorkflowControllerTest.java b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/WorkflowControllerTest.java index 5e7df483..337fea79 100644 --- a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/WorkflowControllerTest.java +++ b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/WorkflowControllerTest.java @@ -257,6 +257,18 @@ public class WorkflowControllerTest { verify(workflowManagerMock).create(reqWorkflow); } + @Test + public void shouldThrowExceptionWhenWorkflowNameInvalid() throws Exception { + + Workflow reqWorkflow = new Workflow(); + reqWorkflow.setName("Invalid workflow name %"); + MockHttpServletResponse response = mockMvc.perform( + post(RestPath.getWorkflowsPath()).header(USER_ID_HEADER_PARAM, USER_ID).contentType(APPLICATION_JSON) + .content(GSON.toJson(reqWorkflow))).andDo(print()) + .andExpect(status().isBadRequest()).andReturn().getResponse(); + assertEquals("Workflow name must contain only letters, digits and underscores", response.getContentAsString()); + } + private List<Workflow> createWorkflows(int numOfWorkflows) { List<Workflow> workflowList = new ArrayList<>(numOfWorkflows); for (int i = 0; i < numOfWorkflows; i++) { |