use of org.grails.plugins.testing.GrailsMockHttpServletRequest in project grails-core by grails.
the class MockGrailsApplication method bindMockHttpRequest.
private GrailsWebRequest bindMockHttpRequest() {
GrailsMockHttpServletRequest mockRequest = new GrailsMockHttpServletRequest();
GrailsMockHttpServletResponse mockResponse = new GrailsMockHttpServletResponse();
GrailsWebRequest webRequest = new GrailsWebRequest(mockRequest, mockResponse, mockRequest.getServletContext());
mockRequest.setAttribute(GrailsApplicationAttributes.WEB_REQUEST, webRequest);
RequestContextHolder.setRequestAttributes(webRequest);
return webRequest;
}
Aggregations