2

有一些 Spring Boot 集成测试,例如:

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

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

构建 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 信息 6556 --- [测试工作者] .btcSpringBootTestContextBootstrapper : 既没有找到 @ContextConfiguration 也没有找到 @ContextHierarchy 用于测试类 [com.odm.integration。 SupplierToSapIntegrationTest],使用 SpringBootContextLoader build 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者] ostcsupport.AbstractContextLoader:无法检测测试类的默认资源位置 [com .odm.integration.SupplierToSapIntegrationTest]:找不到后缀 {-context.xml, Context.groovy} 的资源。构建 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者] tcsAnnotationConfigContextLoaderUtils:无法检测到测试类的默认配置类 [com.odm.integration。SupplierToSapIntegrationTest]:SupplierToSapIntegrationTest 不声明任何使用@Configuration 注释的静态、非私有、非最终、嵌套类。构建 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者] .btcSpringBootTestContextBootstrapper:找到 @SpringBootConfiguration com.odm.OdmBackendApplication 用于测试类 com.odm.integration。 SupplierToSapIntegrationTest build 05-Mai-2017 15:20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者] .btcSpringBootTestContextBootstrapper:从位置加载默认 TestExecutionListener 类名称 [META-INF/spring.factories] :[org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener,org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener,org.springframework.boot.test。20:46 2017-05-05 15:20:46.943 INFO 6556 --- [测试工作者] .btcSpringBootTestContextBootstrapper:无法实例化 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 --- [测试工作者] .btcSpringBootTestContextBootstrapper:使用 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]

任何想法,帮助?谢谢!!

4

0 回答 0