You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the ServletRequest documentation, ServletRequest's two methods for reading the request body - getReader and getInputStream - cannot be used in combination. Implementations are supposed to throw IllegalStateException from either method if the other has already been called.
Revising MockHttpServletRequest to conform to this documented behavior will reinforce the value of Spring Test by allowing users to catch subtle bugs during unit/integration testing, rather than discovering non-compliant usage patterns only when running in an actual container.
Av Pinzur opened SPR-16499 and commented
Per the ServletRequest documentation,
ServletRequest
's two methods for reading the request body -getReader
andgetInputStream
- cannot be used in combination. Implementations are supposed to throwIllegalStateException
from either method if the other has already been called.Revising
MockHttpServletRequest
to conform to this documented behavior will reinforce the value of Spring Test by allowing users to catch subtle bugs during unit/integration testing, rather than discovering non-compliant usage patterns only when running in an actual container.Affects: 4.3.14, 5.0.3
Issue Links:
Referenced from: pull request #1688, and commits 3fc8ec4
The text was updated successfully, but these errors were encountered: