2015-05-12 102 views
2

我正在使用springboot编写集成测试,并使用SpringApplicationConfiguration来加载配置。在teamcity中使用spring-boot和restassured运行集成测试

这是测试类注释样子:

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

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

我是新来的springboot所以也许这个问题是非常新手,但请指出我的正确途径。

回答

0

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

+0

当你说嵌入式tomcat是指你在spring-boot中存在的那个吗? – worrynerd

+0

正确。如果你打包成jar(见pom ),那就是你在做什么 – gyoder

+0

谢谢@gyoder我通过在pom中使用故障安全插件解决了这个问题。 – worrynerd

相关问题