StubConfigHandlerServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  StubConfigHandlerServlet(JsonBasedObjectTransformer jsonBasedObjectTransformer, StubResourceHolder stubResourceHolder, ByteArrayConverter byteArrayConverter);   }
@Test public void testDoPostShouldCallDoGet() throws ServletException, IOException { given(stubResourceHolder.getActualStubConfigJsonObject(DEFAULT_GROUPNAME)).willReturn(null); underTest.doPost(request, response); verify(writer).write(anyString()); verify(writer).flush(); verify(writer).close(); }