springboot单元测试时报错:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
解决办法:
测试类要和SpringBoot的主类在同一个目录下,也就是com.ihrm.company这个包下,不然就报错
springboot单元测试时报错:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
解决办法:
测试类要和SpringBoot的主类在同一个目录下,也就是com.ihrm.company这个包下,不然就报错