FileInputStream inputStreams = new FileInputStream(tempFile);
MultipartFile multipartFile = new MockMultipartFile(tempFile.getName(), tempFile.getName(),
ContentType.APPLICATION_OCTET_STREAM.toString(), inputStreams);<dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> </dependency>