@Test public void testDoPostNormal() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doPost(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
@Test public void testDoPostNormal() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doPost(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
@Test public void testDoPostNormal() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doPost(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
@Test public void testDoPostException() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doPost(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); } }
@Test public void testDoPostException() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doPost(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); } }
@Test public void testDoPostException() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doPost(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); } }