本地Spring Boot集成测试已通过,但在Bamboo上所有测试都失败

时间:2017-05-07 04:39:15

标签: spring-boot integration-testing bamboo spring-boot-test

有一些Spring Boot Integrationtests,例如:

@RunWith(SpringRunner.class)
@SpringBootTest
public class SupplierToSapInvoiceIntegrationTest {
    ...
}

在本地运行时,所有测试都是成功的,但在竹子上,所有测试都失败了。日志说:

  

build 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 ---   [测试工作者] .b.t.c.SpringBootTestContextBootstrapper:都不是   @ContextConfiguration也没有为测试类找到@ContextHierarchy   [com.odm.integration.SupplierToSapIntegrationTest],使用   SpringBootContextLoader build 05-Mai-2017 15:20:46 2017-05-05   15:20:46.943 INFO 6556 --- [测试人员]   o.s.t.c.support.AbstractContextLoader:无法检测到默认值   测试类的资源位置   [com.odm.integration.SupplierToSapIntegrationTest]:找不到资源   用于后缀{-context.xml,Context.groovy}。建立05-Mai-2017   15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者]   t.c.s.AnnotationConfigContextLoaderUtils:无法检测到默认值   测试类的配置类   [com.odm.integration.SupplierToSapIntegrationTest]:   SupplierToSapIntegrationTest不声明任何静态,非私有,   使用@Configuration注释的非final,嵌套类。   建立05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 ---   [测试工作者] .b.t.c.SpringBootTestContextBootstrapper:找到了   @SpringBootConfiguration com.odm.OdmBackendApplication for test class   com.odm.integration.SupplierToSapIntegrationTest build 05-Mai-2017   15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者]   .b.t.c.SpringBootTestContextBootstrapper:默认加载   TestExecutionListener来自位置的类名   [META-INF / spring.factories]:   [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener,   org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener,   org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener,   org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener,   org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener,   org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener,   org.springframework.test.context.web.ServletTestExecutionListener,   org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener,   org.springframework.test.context.support.DependencyInjectionTestExecutionListener,   org.springframework.test.context.support.DirtiesContextTestExecutionListener,   org.springframework.test.context.transaction.TransactionalTestExecutionListener,   org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]   建立05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 ---   [测试工作者] .b.t.c.SpringBootTestContextBootstrapper:不能   实例化TestExecutionListener   [org.springframework.test.context.web.ServletTestExecutionListener]。   指定自定义侦听器类或创建默认侦听器类   (及其所需的依赖关系)可用。违规课程:   [javax / servlet / ServletContext] build 05-Mai-2017 15:20:46
  2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者]   .b.t.c.SpringBootTestContextBootstrapper:使用   TestExecutionListeners:   [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@7beec6bf,   org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@79dadc3e,   org.springframework.test.context.support.DirtiesContextTestExecutionListener@128f4f9c,   org.springframework.test.context.transaction.TransactionalTestExecutionListener@dad26fb,   org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@fbd2cf,   org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@2fefc5c2,   org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@47749c0c,   org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@230af0e7,   org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@7db923e3,   org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2c293843,   org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@4f5e5536]

任何想法,有帮助吗? THX !!

0 个答案:

没有答案