【问题标题】:How to start Spring Boot server with ClassRule in JUnit4?如何在 JUnit4 中使用 ClassRule 启动 Spring Boot 服务器?
【发布时间】:2019-12-28 04:20:44
【问题描述】:

正如我所见,org.springframework.test.context.junit4.rules.SpringClassRuleClassRule 等价于 org.springframework.test.context.junit4.SpringJUnit4ClassRunner

不过,我想用ClassRule 启动我的整个 Spring Boot 应用程序。有没有像org.springframework.boot.test.contextSpringBootTest 这样的ClassRule

【问题讨论】:

    标签: java spring spring-boot junit junit4


    【解决方案1】:

    有一个 GitHub 项目可以解决这个问题:https://github.com/CarloWakefield/spring-boot-test-rule

    【讨论】:

    • 有 -- 链接已失效。
    • @MarkusWMahlberg GitHub 账号好像被删除了。
    猜你喜欢
    • 1970-01-01
    • 2016-09-01
    • 1970-01-01
    • 2015-03-30
    • 2016-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-12
    相关资源
    最近更新 更多