SequenceInformationServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  SequenceInformationServlet(SequenceInformationCollector sequenceInformationCollector);   }
@Test public void testDoPostShouldCallDoGet() throws ServletException, IOException { given(resp.getWriter()).willReturn(printWriter); given(sequenceInformationCollector.collectInformation()).willReturn(new HashMap<String, Object>()); underTest.doPost(req, resp); verify(resp).setContentType("application/json"); verify(printWriter).write("{}"); verify(printWriter).flush(); verify(printWriter).close(); }