WilmaLogHandlerServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  WilmaLogHandlerServlet(LogFilePathProvider filePathProvider, LogFileHandler logFileHandler);   }
@Test public final void testDoPostShouldCallWriteFileContentToResponseWhenPathIsNotEmpty() throws ServletException, IOException { String pathInfo = "/filename"; given(request.getPathInfo()).willReturn(null); given(request.getPathInfo()).willReturn(pathInfo); underTest.doPost(request, response); verify(logFileHandler).writeFileContentToResponse(request, response, pathInfo, path); }