StubResourceHandlerServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  StubResourceHandlerServlet(FileListJsonBuilder fileListJsonBuilder, StubResourcePathProvider stubResourcePathProvider, ResourceFileNameHandler resourceFileNameHandler);   }
@Test public void testDoPostWhenRequestPathInfoIsNullShouldCallHandleRequest() throws ServletException, IOException { given(request.getParameter(TYPE_PARAMETER)).willReturn(TEMPLATE); given(stubResourcePathProvider.getTemplatesPath()).willReturn(path); given(request.getPathInfo()).willReturn(PATH_INFO); underTest.doPost(request, response); verify(resourceFileNameHandler).writeResourceFile(response, PATH_INFO, path); }