X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdatarouter.git;a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2FGroupServletTest.java;h=a0781264a6db37f7420a6f454e9293fcb5e0adda;hp=d6f1e6dc8a0b4bf5bc664683957282273ac3af7e;hb=ee6fa61e2cd7df99891092709765235b6166a041;hpb=f926474924870c9ed4d5c4c8ccba55a1942d8e37 diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/GroupServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/GroupServletTest.java index d6f1e6dc..a0781264 100755 --- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/GroupServletTest.java +++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/GroupServletTest.java @@ -154,7 +154,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_PUT_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); ServletInputStream inStream = mock(ServletInputStream.class); when(request.getInputStream()).thenReturn(inStream); groupServlet.doPut(request, response); @@ -163,7 +163,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_PUT_And_Group_Name_Is_Too_Long_Then_Bad_Request_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnAnInvalidGroup(true); groupServlet.doPut(request, response); verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class))); @@ -171,7 +171,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_PUT_And_PUT_Fails_Then_Internal_Server_Error_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnAValidGroupWithFail(); groupServlet.doPut(request, response); verify(response).sendError(eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), argThat(notNullValue(String.class))); @@ -179,7 +179,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_PUT_And_Request_Succeeds() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnGroupInDb(); ServletOutputStream outStream = mock(ServletOutputStream.class); when(response.getOutputStream()).thenReturn(outStream); @@ -210,7 +210,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_POST_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); ServletInputStream inStream = mock(ServletInputStream.class); when(request.getInputStream()).thenReturn(inStream); groupServlet.doPost(request, response); @@ -219,7 +219,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_POST_And_Group_Description_Is_Too_Long_Then_Bad_Request_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnAnInvalidGroup(false); groupServlet.doPost(request, response); verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class))); @@ -227,7 +227,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_POST_And_Group_Name_Already_Exists_Then_Bad_Request_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnGroupInDb(); groupServlet.doPost(request, response); verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class))); @@ -235,7 +235,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_POST_And_POST_Fails_Then_Internal_Server_Error_Response_Is_Generated() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnAValidGroupWithFail(); groupServlet.doPost(request, response); verify(response).sendError(eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), argThat(notNullValue(String.class))); @@ -243,7 +243,7 @@ public class GroupServletTest { @Test public void Given_Request_Is_HTTP_POST_And_Request_Succeeds() throws Exception { - when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0"); + when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0"); GroupServlet groupServlet = overideGetJSONFromInputToReturnNewGroupToInsert(); ServletOutputStream outStream = mock(ServletOutputStream.class); when(response.getOutputStream()).thenReturn(outStream);