【发布时间】:2019-04-22 08:21:43
【问题描述】:
我的 Spring Boot 1.5.17 (Spring 4.3.20) 服务器可以在 bootRun 或部署时正常工作。
但是,我的 Oracle 数据源仅在单元测试时失败:
java.lang.AssertionError: 服务器正在发送一个非空的重播上下文 但是我们的 replayModes=[]
针对此错误的 Google 搜索没有确切的结果。
我能够使用不同的 Oracle 数据库进行单元测试。
我在完整的应用程序测试上下文中遇到错误
@RunWith(SpringRunner.class)
@SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
classes = { TestingUserConfiguration.class, Application.class }
)
以及单个 DataSource 配置和服务
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {
MyDbConfig.class,
MyService.class
})
oracle.jdbc.pool.OracleDataSource 和 oracle.jdbc.replay.OracleConnectionPoolDataSourceImpl 都有错误。
UCP 没有区别。
OracleConnectionPoolDataSourceImpl 有不同的错误:
java.sql.SQLException:不支持的功能
尝试从 OJDBC 12.2 升级到 2018.3,没有区别。
以前有人见过这个错误吗? 关于为什么它只出现在 Spring 单元测试中的任何想法?
【问题讨论】:
-
我也正在遭受这样的痛苦:community.oracle.com/message/15117270#15117270
标签: oracle spring-boot jdbc