Set UTF-8 as default multipart charset to ContentRequestMatchers
See gh-31924
This commit is contained in:
committed by
rstoyanchev
parent
f9883d8bd6
commit
667e30f580
@@ -60,6 +60,8 @@ import static org.springframework.test.util.AssertionErrors.assertTrue;
|
||||
*/
|
||||
public class ContentRequestMatchers {
|
||||
|
||||
private static final String DEFAULT_ENCODING = "UTF-8";
|
||||
|
||||
private final XmlExpectationsHelper xmlHelper;
|
||||
|
||||
private final JsonExpectationsHelper jsonHelper;
|
||||
@@ -367,7 +369,9 @@ public class ContentRequestMatchers {
|
||||
public static MultiValueMap<String, ?> parse(MockClientHttpRequest request) {
|
||||
try {
|
||||
FileUpload fileUpload = new FileUpload();
|
||||
fileUpload.setFileItemFactory(new DiskFileItemFactory());
|
||||
DiskFileItemFactory factory = new DiskFileItemFactory();
|
||||
factory.setDefaultCharset(DEFAULT_ENCODING);
|
||||
fileUpload.setFileItemFactory(factory);
|
||||
|
||||
List<FileItem> fileItems = fileUpload.parseRequest(new UploadContext() {
|
||||
private final byte[] body = request.getBodyAsBytes();
|
||||
|
||||
Reference in New Issue
Block a user