@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { doGet(request, response); } }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { doGet(request, response); } }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { doGet(request, response); } }
public void testDoGetNormal() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
public void testDoGetNormal() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
public void testDoGetNormal() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(internalResponse); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_OK, RESPONSE_BODY); }
@Test public void testDoPostHttpError() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoGetHttpError() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoGetHttpError() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoPostHttpError() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoGetHttpError() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoPostHttpError() throws Exception { setupPost(); expect(pipeline.execute(internalRequest)).andReturn(HttpResponse.notFound()); replay(); servlet.doGet(request, recorder); assertResponseOk(HttpResponse.SC_NOT_FOUND, ""); }
@Test public void testDoGetException() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doGet(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); }
@Test public void testDoGetException() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doGet(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); }
@Test public void testDoGetException() throws Exception { setupGet(); expect(pipeline.execute(internalRequest)).andThrow( new GadgetException(GadgetException.Code.FAILED_TO_RETRIEVE_CONTENT, ERROR_MESSAGE)); replay(); servlet.doGet(request, recorder); assertEquals(HttpServletResponse.SC_BAD_REQUEST, recorder.getHttpStatusCode()); assertContains(ERROR_MESSAGE, recorder.getResponseAsString()); }