我的Controller其中一个方法如下,入参之一是CommonsMultipartFile 类型,请问在单元测试中如何构造CommonsMultipartFile 实例进行单元测试
@ModelAttribute
public PicUpload get(@RequestParam(required = false) String id,
@RequestParam(required = false) CommonsMultipartFile picupload) {
PicUpload entity = null;
if (StringUtils.isNotBlank(id)) {
entity = picUploadService.get(id);
}
if (entity == null) {
entity = new PicUpload();
}
return entity;
}
侃侃无极