0
点赞
收藏
分享

微信扫一扫

解决,you need to use @ContextConfiguration or @SpringBootTest(classes=...)

背景

Spring cloud 项目编写 单元测试时,报错如下:

you need to use @ContextConfiguration or @SpringBootTest(classes=...)


方法

spring cloud 项目编写单元测试需要指定 启动类。

@RunWith(SpringRunner.class)
@SpringBootTest(classes = CrmServerApplication.class)

举报

相关推荐

Attention Is All You Need

0 条评论