SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration
SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration
@SpringBootTest 测试时出现 异常内容:
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) …
原因:
test 中的测试类的包名和 java 下的包名不一致导致,找不到
解决方法一(建议):
将 test 中的 测试类包名改成和上面一致
解决方法二:
在注解上指定启动类
@SpringBootTest(classes = Application.class))
还没有评论,来说两句吧...