美文网首页
SpringBootTest异常

SpringBootTest异常

作者: cjlynn | 来源:发表于2020-02-07 17:38 被阅读0次

springboot test无法启动出现异常

@RunWith(SpringRunner.class)
@SpringBootTest
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) 
结果发现是测试类包不跟启动类包一致,修改一致即可。

相关文章

网友评论

      本文标题:SpringBootTest异常

      本文链接:https://www.haomeiwen.com/subject/ctcvxhtx.html