### Question:
WikiServlet extends HttpServlet { @Override public void doGet( final HttpServletRequest req, final HttpServletResponse res ) throws IOException, ServletException { String pageName = URLConstructor.parsePageFromURL( req, m_engine.getContentEncoding() ); log.info( "Request for page: " + pageName ); if( pageName == null ) { pageName = m_engine.getFrontPage(); } final String jspPage = m_engine.getManager( URLConstructor.class ).getForwardPage( req ); final RequestDispatcher dispatcher = req.getRequestDispatcher( "/" + jspPage + "?page=" + m_engine.encodeName( pageName ) + "&" + req.getQueryString() ); dispatcher.forward( req, res ); }  @Override void init( final ServletConfig config ); @Override void destroy(); @Override void doPost( final HttpServletRequest req, final HttpServletResponse res ); @Override void doGet( final HttpServletRequest req, final HttpServletResponse res );  }### Answer:
@Test public void testDoGet() throws Exception { final MockHttpServletRequest req = new MockHttpServletRequest( "/JSPWiki", "/wiki/Wiki.jsp" ); final MockHttpServletResponse res = new MockHttpServletResponse(); final WikiServlet wikiServlet = new WikiServlet(); final MockServletConfig config = new MockServletConfig(); config.setServletContext( TestEngine.createServletContext( "/JSPWiki" ) ); wikiServlet.init( config ); wikiServlet.doGet( req, res ); wikiServlet.destroy(); Assertions.assertEquals( "/Wiki.jsp?page=Main&", req.getForwardUrl() ); }