How to send a multipart request with RestAssured?
问题 I have @Controller with method with signature like this: @PostMapping @ResponseBody public ResponseEntity<Result> uploadFileAndReturnJson(@RequestParam("file") MultipartFile file) {} I want to construct multipart request without physically creating any file. I tried doing it like this: private MultiPartSpecification getMultiPart() { return new MultiPartSpecBuilder("111,222") .mimeType(MimeTypeUtils.MULTIPART_FORM_DATA.toString()) .controlName("file") .fileName("file") .build(); } Response