Skip to content

Commit b4a0e71

Browse files
committed
1 parent 7fe0116 commit b4a0e71

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ public byte[] getContentAsByteArray() {
207207
}
208208

209209
/**
210-
* Get the content of the response body as a {@code String}, using the configured
211-
* {@linkplain #getCharacterEncoding character encoding}.
210+
* Get the content of the response body as a {@code String}, using the charset
211+
* specified for the response by the application, either through
212+
* {@link HttpServletResponse} methods or through a charset parameter on the
213+
* {@code Content-Type}.
212214
* @return the content as a {@code String}
213215
* @throws UnsupportedEncodingException if the character encoding is not supported
214216
* @see #getContentAsString(Charset)
@@ -221,7 +223,9 @@ public String getContentAsString() throws UnsupportedEncodingException {
221223
/**
222224
* Get the content of the response body as a {@code String}, using the provided
223225
* {@code fallbackCharset} if no charset has been explicitly defined and otherwise
224-
* using the configured {@linkplain #getCharacterEncoding character encoding}.
226+
* using the charset specified for the response by the application, either
227+
* through {@link HttpServletResponse} methods or through a charset parameter on the
228+
* {@code Content-Type}.
225229
* @return the content as a {@code String}
226230
* @throws UnsupportedEncodingException if the character encoding is not supported
227231
* @since 5.2

0 commit comments

Comments
 (0)