I am running spring boot v2.3.5 application with oracleDb (com.oracle.jdbc.ojdbc8 v12.2.0.1) and following testcontainer dependencies:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.20.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-free</artifactId>
<scope>test</scope>
</dependency>
Here is the testcontainer initialization:
public class TestcontainersInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
static OracleContainer oracleContainer = new OracleContainer("gvenzl/oracle-free:23.5-slim-faststart")
.withStartupTimeout(Duration.ofMinutes(3))
.withDatabaseName("test")
.withPassword("test")
.withPrivilegedMode(true)
;
static {
Startables.deepStart(oracleContainer).join();
}
@Override
public void initialize(ConfigurableApplicationContext ctx) {
TestPropertyValues.of(
"spring.jpa.hibernate.ddl-auto=none",
"spring.datasource.url=" + oracleContainer.getJdbcUrl(),
"spring.datasource.username=" + oracleContainer.getUsername(),
"spring.datasource.password=" + oracleContainer.getPassword(),
"spring.flyway.enabled=" + "true",
"spring.flyway.url=" + oracleContainer.getJdbcUrl(),
"spring.flyway.user=" + oracleContainer.getUsername(),
"spring.flyway.password=" + oracleContainer.getPassword(),
"spring.flyway.schemas="
).applyTo(ctx.getEnvironment());
}
}
While the application is running, flyway scripts are running. But flyway fails for following sql content:
CREATE USER dummy_user IDENTIFIED BY dummy_password;
and says: ORA-01031: insufficient privileges
I couldn’t find any solution to solve this issue. How can i solve this issue
You need to sign in to view this answers
Leave feedback about this