Skip to content

Commit f846d94

Browse files
committed
Add Javadoc to MockHttpServletResponse
This commit adds Javadoc to the `getContentLength` method of `MockHttpServletResponse` to reflect that it gets its value from the HTTP response header. Closes gh-31833
1 parent 50069ef commit f846d94

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ public void setContentLength(int contentLength) {
320320
doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true);
321321
}
322322

323+
/**
324+
* Get the length of the content body from the HTTP Content-Length header.
325+
* @return the value of the Content-Length header
326+
* @see #setContentLength(int)
327+
*/
323328
public int getContentLength() {
324329
return (int) this.contentLength;
325330
}

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ public void setContentLength(int contentLength) {
320320
doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true);
321321
}
322322

323+
/**
324+
* Get the length of the content body from the HTTP Content-Length header.
325+
* @return the value of the Content-Length header
326+
* @see #setContentLength(int)
327+
*/
323328
public int getContentLength() {
324329
return (int) this.contentLength;
325330
}

0 commit comments

Comments
 (0)