IllegalAccessException, ServletException, IOException {
ServletContext servletContext = new MockServletContext();
ServletConfig servletConfig = new MockServletConfig(servletContext);
MockHttpSession httpSession = new MockHttpSession();
httpSession.setAttributes(sessionAttributes);
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(httpSession);
request.setMethod(httpMethod);
request.setAttributes(requestAttributes);
MockHttpServletResponse response = new MockHttpServletResponse(getRenderedResponse());
MockJspWriter jspWriter = configureJspFactory(servletContext, request, httpSession);
initializeAndInvokeJsp(jspClass, servletConfig, request, response);
writeOutputToTempFile(jspWriter.getContents());
}