mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Fix UTF-8 handling in ContentResultMatchers
Closes gh-23622
This commit is contained in:
+2
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.test.web.servlet.result;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -210,7 +211,7 @@ public class ContentResultMatchers {
|
||||
*/
|
||||
public ResultMatcher json(String jsonContent, boolean strict) {
|
||||
return result -> {
|
||||
String content = result.getResponse().getContentAsString();
|
||||
String content = result.getResponse().getContentAsString(StandardCharsets.UTF_8);
|
||||
this.jsonHelper.assertJsonEqual(jsonContent, content, strict);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user