【问题标题】:running integration tests in teamcity using spring-boot and restassured使用 spring-boot 在 teamcity 中运行集成测试并放心
【发布时间】:2015-07-23 17:16:46
【问题描述】:

我正在使用 springboot 和 rest-assured 编写我的集成测试,并使用 SpringApplicationConfiguration 来加载配置。

这是测试类注解的样子:

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = RestAPIApplication.class)
@IntegrationTest("server.port:8083") // this is the port set by my application 

现在是我真正的问题。当我使用 maven 在 teamcity 中运行测试类时,在运行集成测试之前我不需要配置一些东西来运行 springboot 服务器吗?

我是springboot的新手,所以这个问题可能很新手,但请指出正确的路径。

【问题讨论】:

    标签: maven teamcity spring-boot rest-assured


    【解决方案1】:

    如果您使用的是嵌入式 tomcat,则无需额外设置 - 只需运行 maven 测试即可。

    【讨论】:

    • 当您说嵌入式tomcat时,您指的是spring-boot中存在的那个吗?
    • 正确。如果您将包装为罐子(请参阅 pom ),那就是您正在做的事情
    • 感谢 @gyoder 我通过在 pom 中使用故障安全插件解决了这个问题。
    猜你喜欢
    • 1970-01-01
    • 2020-02-10
    • 2015-02-10
    • 2020-12-05
    • 2018-02-01
    • 2020-09-29
    • 1970-01-01
    • 2020-07-24
    • 2022-06-23
    相关资源
    最近更新 更多