1.在web项目(即含有SpringApplication启动类)中test目录新建测试类,包路径和SpringApplication中的扫描路径一致,否则无法启动测试类。若测试类的包路径和启动类的包路径不一致,会出现以下错误信息

Could not detect default resource locations for test(画红线包路径要一致)

Junit单元测试:Could not detect default resource locations for test

相关文章:

  • 2021-05-24
  • 2021-10-01
  • 2021-05-24
猜你喜欢
  • 2021-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案