SpringBoot测试报错:java.lang.IllegalStateException Unable to find a @SpringBootConfiguration

跑Spring Boot测试时,一开始源码包路径为com.whf.product,而测试包路径为com.whf,导致跑测试类时提示找不到配置类,一开始也没想到会有这种问题,参考下面的博客,将两者改成一致即可。记录一下。。。

参考博客:https://www.cnblogs.com/xing-nb/p/12147304.html

SpringBoot测试报错:java.lang.IllegalStateException Unable to find a @SpringBootConfiguration