BlockLocalhostUsageResponseServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); }    }
@Test public void testDoPostShouldDoTheSameAsDoGet() throws ServletException, IOException { given(resp.getWriter()).willReturn(printWriter); underTest.doPost(req, resp); verify(resp).setContentType(TEXT_PLAIN); verify(resp).setStatus(ERROR_CODE); verify(printWriter).write(BLOCKED_REQUEST_MESSAGE); }