matrei commented on code in PR #15541:
URL: https://github.com/apache/grails-core/pull/15541#discussion_r3031734965
##########
grails-test-core/src/main/groovy/org/grails/plugins/testing/AbstractGrailsMockHttpServletResponse.groovy:
##########
@@ -109,7 +109,7 @@ abstract class AbstractGrailsMockHttpServletResponse
extends MockHttpServletResp
final webRequest = GrailsWebRequest.lookup()
webRequest?.currentRequest?.removeAttribute(GrailsApplicationAttributes.REDIRECT_ISSUED)
setCommitted(false)
- def field = ReflectionUtils.findField(MockHttpServletResponse,
'writer')
+ def field = ReflectionUtils.findField(MockHttpServletResponse,
'outputStream')
Review Comment:
@jamesfredley @jdaugherty This was my change, to get `reset()` working again
in `AbstractGrailsMockHttpServletResponse` after changes to the Spring
`MockHttpServletResponse` class in Spring 6.
Changing to nulling `outputStream` instead of `writer` make it work like
before. It is a bit of a hack, but this has always been the case, regardless of
the field that is nulled.
This caused `RenderMethodTests.testRenderFile()` to fail after upgrade to
Spring Boot 4. The `reset()` call has since been removed in that test, and that
is why it no longer fails with this change reverted.
But the issue remains, you cannot call
`AbstractGrailsMockHttpServletResponse.reset()` with the field set to `writer`
in Spring 6.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]