Av Pinzur opened SPR-16499 and commented
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.
Affects: 4.3.14, 5.0.3
Issue Links:
Referenced from: pull request #1688, and commits 3fc8ec4
Av Pinzur opened SPR-16499 and commented
Per the ServletRequest documentation,
ServletRequest's two methods for reading the request body -getReaderandgetInputStream- cannot be used in combination. Implementations are supposed to throwIllegalStateExceptionfrom either method if the other has already been called.Revising
MockHttpServletRequestto 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