正如我所看到的,org.springframework.test.context.junit4.rules.SpringClassRule
相当于 ClassRule
的 org.springframework.test.context.junit4.SpringJUnit4ClassRunner
.
但是,我想使用 ClassRule
启动我的整个 Spring Boot 应用程序。是否有类似 org.springframework.boot.test.contextSpringBootTest
作为 ClassRule
的东西?
最佳答案
有一个 GitHub 项目可以解决这个问题:https://github.com/CarloWakefield/spring-boot-test-rule
关于java - 如何在JUnit4中使用ClassRule启动Spring Boot服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57616164/