Junit单元测试:Could not detect default resource locations for test
文章目录
在web项目(即含有SpringApplication启动类)中test目录新建测试类,包路径和SpringApplication中的扫描路径一致,否则无法启动测试类。若测试类的包路径和启动类的包路径不一致,会出现以下错误信息
Could not detect default resource locations for test(画红线包路径要一致)

在web项目(即含有SpringApplication启动类)中test目录新建测试类,包路径和SpringApplication中的扫描路径一致,否则无法启动测试类。若测试类的包路径和启动类的包路径不一致,会出现以下错误信息
Could not detect default resource locations for test(画红线包路径要一致)

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论