2

I know this question has been asked here before, for example here, however, most of the answers use MockMultipartFile to do the job. However, it seems that this class should be in the scope of test.

Another class that implements the interface MultipartFile, it is the CommonsMultipartFile.

However, using MockMultipartFile seems to be a lot easier to use than CommonsMultipartFile.

The question is: What is the correct way to transform a File to MultipartFile, since MockMultipartFile is on the package of mock and CommonsMultipartFile is not

Community
  • 1
  • 1
Gabriel
  • 952
  • 10
  • 31

0 Answers0