【发布时间】:2018-10-18 19:31:56
【问题描述】:
在我的测试中,我需要使用不同的数据库(mysql、oracle 等)进行测试,我想知道 SpringRunner 是否可以。
我正在使用@SqlGroup 和@Sql 注释,但是我没有发现如何指示脚本文件(sql)对应的数据库。
例子:
@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:tenantBeforeTestRun.sql")
此注释将我的测试配置为对所有数据库类型执行脚本,但此文件在 Oracle 上不起作用。
【问题讨论】:
-
您可能需要提供配置和 Spring Boot 应用程序才能知道问题所在。
标签: java spring spring-boot testing integration-testing