How to resolve MethodArgumentConversionNotSupportedException with MockMvc?
问题 I'm writing a unit test for a controller method that accepts a MultipartFile and a custom object MessageAttachment . So far I can see that the MultipartFile is the correct format for the request but the MessageAttachment is not. The parsing of the messageAttachment throws a server side 500 error with MethodArgumentConversionNotSupportedException . It seem to be an issue with converting the MessageAttachment to a MockMultipartFile in the test. This is similar to the example shown here - https: