Improve no content handling in MockHttpServletRequest

Issue: SPR-11764
This commit is contained in:
Rossen Stoyanchev
2014-06-06 11:25:15 -04:00
parent 9706e5cc99
commit c269d27bde
3 changed files with 29 additions and 4 deletions

View File

@@ -107,6 +107,9 @@ public class MockHttpServletRequest implements HttpServletRequest {
private static final String CHARSET_PREFIX = "charset=";
private static final ServletInputStream EMPTY_SERVLET_INPUT_STREAM =
new DelegatingServletInputStream(new ByteArrayInputStream(new byte[0]));
private boolean active = true;
@@ -378,7 +381,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
return new DelegatingServletInputStream(new ByteArrayInputStream(this.content));
}
else {
return null;
return EMPTY_SERVLET_INPUT_STREAM;
}
}