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