【发布时间】:2019-12-10 00:23:57
【问题描述】:
我尝试使用带有 Oracle-XE 模块和 Spring Boot 的测试容器,到目前为止,当我启动测试时,我遇到了异常:
Caused by: java.lang.IllegalArgumentException: JDBC URL matches jdbc:tc: prefix but the database or tag name could not be identified
在我的src/test/application.properties 中,我将 url 数据源声明为:
spring.datasource.url=jdbc:tc:oracle-xe://somehostname:someport/databasename?TC_INITSCRIPT=schema-test.sql
为了指示要为 oracle-xe 拉取的 docker 映像,我在 src/test/resources 中创建了文件 testcontainers.properties:
oracle.container.image=oracleinanutshell/oracle-xe-11g:1.0.0
您知道如何完成这项工作吗?
它与 MySQL 完美配合,使用数据源 url:
spring.datasource.url=jdbc:tc:mysql:5.6.23://somehostname:someport/databasename?TC_INITSCRIPT=schema-test.sql
【问题讨论】:
标签: spring spring-boot oracle-xe testcontainers