我在下面显示的错误。
我怎么能解决这个问题?
:compileJavaD:\工作空间\ Safencesgradle \ SRC \主\的java \ COM \ anzen \ safences \其余\ FileUploadService.java:17: 错误:包org.springframework.mock.web不存在导入 org.springframework.mock.web.MockMultipartFile; ^ D:\ workspace \ Safencesgradle \ src \ main \ java \ com \ anzen \ safences \ rest \ FileUploadService.java:43: 错误:找不到符号MultipartFile result = new MockMultipartFile(fileFormDataContentDisposition.getName() ^符号:类MockMultipartFile位置:类FileUploadService
答案 0 :(得分:-1)
请将jar spring-mock.xxx.jar(org.springframework.mock.web.MockMultipartFile)导入gradle配置。
将以下代码放在build.gradle中:
dependencies {
testCompile group: 'org.springframework', name: 'spring-mock', version: '2.0.8'
}