diff options
author | ayalaben <ayala.benzvi@amdocs.com> | 2018-07-26 11:10:49 +0300 |
---|---|---|
committer | ayalaben <ayala.benzvi@amdocs.com> | 2018-07-26 12:17:32 +0300 |
commit | 3a530ec00f047e306eb53961ad71ca67f545773c (patch) | |
tree | ccc8b91fe5ac116b76f63a1e290bf8dda2215e77 /workflow-designer-be/src/test | |
parent | ba978ad1cbaedef616e5883717da7494b634a2ff (diff) |
Validator init binder fix
Change-Id: I98ac7b42512a4f7b1323e29ed5059553479b24e0
Issue-ID: SDC-1518
Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'workflow-designer-be/src/test')
-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++) { |