Skip to content

Commit

Permalink
Use same servletContext instance for GrailsMockHttpServletRequest and…
Browse files Browse the repository at this point in the history
… the applicationContext instance
  • Loading branch information
lhotari committed Jan 22, 2014
1 parent 902435e commit 872ee15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ class ControllerUnitTestMixin extends GrailsUnitTestMixin {
ServletsGrailsPluginSupport.enhanceServletApi()
ConvertersPluginSupport.enhanceApplication(grailsApplication,applicationContext)

request = new GrailsMockHttpServletRequest(requestMimeTypesApi: new TestRequestMimeTypesApi(grailsApplication: grailsApplication, applicationContext: applicationContext))
request = new GrailsMockHttpServletRequest(servletContext)
request.requestMimeTypesApi = new TestRequestMimeTypesApi(grailsApplication: grailsApplication, applicationContext: applicationContext)
response = new GrailsMockHttpServletResponse(responseMimeTypesApi: new TestResponseMimeTypesApi(grailsApplication: grailsApplication, applicationContext: applicationContext))
webRequest = GrailsWebUtil.bindMockWebRequest(applicationContext, request, response)
request = (GrailsMockHttpServletRequest)webRequest.getCurrentRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ class GrailsMockHttpServletRequest extends MockHttpServletRequest implements Mul
private cachedXml
DispatcherType dispatcherType
AsyncContext asyncContext


public GrailsMockHttpServletRequest() {
super();
}

public GrailsMockHttpServletRequest(ServletContext servletContext) {
super(servletContext);
}

/**
* Sets the request format to use
Expand Down

0 comments on commit 872ee15

Please sign in to comment.