Spring boot 本地Spring引导集成测试通过,但所有测试都失败
进行一些Spring Boot集成测试,例如:Spring boot 本地Spring引导集成测试通过,但所有测试都失败,spring-boot,integration-testing,bamboo,spring-boot-test,Spring Boot,Integration Testing,Bamboo,Spring Boot Test,进行一些Spring Boot集成测试,例如: @RunWith(SpringRunner.class) @SpringBootTest public class SupplierToSapInvoiceIntegrationTest { ... } 在本地运行时,所有测试都成功,但在本地运行时,所有测试都失败。日志上写着: 构建05-Mai-2017 15:20:46 2017-05-05 15:20:46.943信息6556--- [Test worker].b.t.c.Sprin
@RunWith(SpringRunner.class)
@SpringBootTest
public class SupplierToSapInvoiceIntegrationTest {
...
}
在本地运行时,所有测试都成功,但在本地运行时,所有测试都失败。日志上写着:
构建05-Mai-2017 15:20:46 2017-05-05 15:20:46.943信息6556---
[Test worker].b.t.c.SpringBootTestContextBootstrapper:两者都不是
@为测试类找到ContextConfiguration或@ContextHierarchy
[com.odm.integration.suppliertosapiintegrationtest],使用
SpringBootContextLoader构建05-Mai-2017 15:20:46 2017-05-05
15:20:46.943信息6556---[测试人员]
o、 s.t.c.support.AbstractContextLoader:无法检测默认值
测试类的资源位置
[com.odm.integration.suppliertosapiintegrationtest]:未找到任何资源
对于后缀{-context.xml,context.groovy}。2017年5月5日建造
15:20:46 2017-05-05 15:20:46.943信息6556---[测试工人]
t、 c.s.AnnotationConfigContextLoaderUtils:无法检测默认值
测试类的配置类
[com.odm.integration.suppliertosapiintegrationtest]:
SupplierToCapintegrationTest未声明任何静态、非私有、,
用@Configuration注释的非最终嵌套类。
构建05-Mai-2017 15:20:46 2017-05-05 15:20:46.943信息6556---
[Test worker].b.t.c.SpringBootTestContextBootstrapper:找到
@测试类的SpringBootConfiguration com.odm.OdmBackendApplication
com.odm.integration.suppliertosapiintegrationtestbuild 05-Mai-2017
15:20:46 2017-05-05 15:20:46.943信息6556---[测试工人]
.b.t.c.SpringBootTestContextBootstrapper:加载默认值
来自位置的TestExecutionListener类名
[META-INF/spring.factories]:
[org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener,
org.springframework.boot.test.mock.mockito.resetMocksteExecutionListener,
org.springframework.boot.test.autoconfigure.restdocs.restdocstexecutionListener,
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.dirtiesContextBeforeModesteExecutionListener,
org.springframework.test.context.support.DependencyInjectionTestExecutionListener,
org.springframework.test.context.support.DirtiesContextTestExecutionListener,
org.springframework.test.context.transaction.TransactionalTestExecutionListener,
org.springframework.test.context.jdbc.sqlscriptstexecutionListener]
构建05-Mai-2017 15:20:46 2017-05-05 15:20:46.943信息6556---
[Test worker].b.t.c.SpringBootTestContextBootstrapper:无法
实例化TestExecutionListener
[org.springframework.test.context.web.ServletTestExecutionListener]。
指定自定义侦听器类或创建默认侦听器类
(及其所需的依赖项)可用。违规类别:
[javax/servlet/ServletContext]构建05-Mai-2017 15:20:462017-05-05 15:20:46.943信息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] 有什么主意吗,帮帮忙?谢谢