Search in sources :

Example 1 with MockHttpSession

use of net.sourceforge.stripes.mock.MockHttpSession in project jspwiki by apache.

the class TestEngine method newHttpRequest.

/**
 * Creates a correctly-instantiated mock HttpServletRequest with an associated
 * HttpSession and path.
 * @param path the path relative to the wiki context, for example "/Wiki.jsp"
 * @return the new request
 */
public MockHttpServletRequest newHttpRequest(String path) {
    MockHttpServletRequest request = new MockHttpServletRequest("/JSPWiki", path);
    request.setSession(new MockHttpSession(this.getServletContext()));
    request.addLocale(new Locale(""));
    return request;
}
Also used : Locale(java.util.Locale) MockHttpServletRequest(net.sourceforge.stripes.mock.MockHttpServletRequest) MockHttpSession(net.sourceforge.stripes.mock.MockHttpSession)

Aggregations

Locale (java.util.Locale)1 MockHttpServletRequest (net.sourceforge.stripes.mock.MockHttpServletRequest)1 MockHttpSession (net.sourceforge.stripes.mock.MockHttpSession)1