### Question:
LogServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String fileName = request.getParameter("fileName"); process(request, response, fileName); }    }### Answer:
@Test public void testDoPost() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateResultingPage(response, "View Logs on - localhost"); }