diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java index c0df344d7d..9ee769a2d1 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java @@ -320,6 +320,11 @@ public class MockHttpServletResponse implements HttpServletResponse { doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true); } + /** + * Get the length of the content body from the HTTP Content-Length header. + * @return the value of the Content-Length header + * @see #setContentLength(int) + */ public int getContentLength() { return (int) this.contentLength; } diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java index b88907feb7..e9064219cc 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java @@ -320,6 +320,11 @@ public class MockHttpServletResponse implements HttpServletResponse { doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true); } + /** + * Get the length of the content body from the HTTP Content-Length header. + * @return the value of the Content-Length header + * @see #setContentLength(int) + */ public int getContentLength() { return (int) this.contentLength; }