https://github.com/spring-projects/spring-framework/blob/a01c6d57bb23bf885bed07060c98ffb8828521ff/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java#L323-L325

Leveraged this Class, MockHttpServletResponse, to write some tests and initially found the behavior of this getter, getContentLength confusing. After reaching this SO post and reading the process the poster followed in their comments, the source of my confusion became clear. That being, the content length was referring to the header value for Content-Length, not the response, payload's length, if you will.

https://stackoverflow.com/questions/52005034/spring-boot-test-mockhttpservletresponse-getcontentlength-return-0-despite-of

Wondered if the team/maintainers would find any value in updating the Javadocs with a hint that would help clarify to which "length" value the API is fetching... even though it is clearly included in the method name itself. With modern IDE's autocompleting and bringing up tool tips, this might help draw focus to the "content" part of the name. Could extend this work to the Long version of the method as well.

Would be willing to raise a PR if there is consensus.

And not to wonder off in too much of a tangent here, perhaps a more direct method to calculate/verify the payload length might be worthwhile as well.

Thoughts?