From b4a0e71ccc59af566557df06785d60ce91c64285 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Tue, 16 Jul 2019 18:46:36 +0200 Subject: [PATCH] Polishing See gh-23219 --- .../mock/web/MockHttpServletResponse.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 195b8a94e3..95b03df8d2 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 @@ -207,8 +207,10 @@ public class MockHttpServletResponse implements HttpServletResponse { } /** - * Get the content of the response body as a {@code String}, using the configured - * {@linkplain #getCharacterEncoding character encoding}. + * Get the content of the response body as a {@code String}, using the charset + * specified for the response by the application, either through + * {@link HttpServletResponse} methods or through a charset parameter on the + * {@code Content-Type}. * @return the content as a {@code String} * @throws UnsupportedEncodingException if the character encoding is not supported * @see #getContentAsString(Charset) @@ -221,7 +223,9 @@ public class MockHttpServletResponse implements HttpServletResponse { /** * Get the content of the response body as a {@code String}, using the provided * {@code fallbackCharset} if no charset has been explicitly defined and otherwise - * using the configured {@linkplain #getCharacterEncoding character encoding}. + * using the charset specified for the response by the application, either + * through {@link HttpServletResponse} methods or through a charset parameter on the + * {@code Content-Type}. * @return the content as a {@code String} * @throws UnsupportedEncodingException if the character encoding is not supported * @since 5.2