MessageHandlerServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  MessageHandlerServlet(LogFilePathProvider filePathProvider, MessageFileHandler messageFileHandler);   }
@Test public final void testDoPostShouldCallWriteFileContentToResponseWhenPathIsNotEmpty() throws ServletException, IOException { given(request.getPathInfo()).willReturn(null); underTest.doPost(request, response); verify(messageFileHandler).writeFileNamesToResponse(response, path); }