小编Ila*_*ler的帖子

在junit5中使用SpringRunner有什么特别的配置吗?

我的微服务项目基于 spring-boot 框架,我所有的单元测试都在 spring runner 上运行。

@RunWith(SpringRunner.class)
Run Code Online (Sandbox Code Playgroud)

添加此注释,导入以下库:

import org.springframework.test.context.junit4.SpringRunner;
Run Code Online (Sandbox Code Playgroud)

如何将我的测试类设置为与 junit5 一起运行?

junit spring-boot junit5 spring-boot-test springrunner

8
推荐指数
3
解决办法
8756
查看次数