Move Flyway testcontainers support into spring-boot-flyway

See gh-46086
This commit is contained in:
Stéphane Nicoll
2025-07-01 12:01:06 +01:00
committed by Andy Wilkinson
parent 8f54873227
commit ac16a7919b
9 changed files with 21 additions and 7 deletions
@@ -20,6 +20,7 @@ plugins {
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.optional-dependencies"
}
@@ -32,9 +33,17 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("org.flywaydb:flyway-database-oracle")
optional("org.flywaydb:flyway-database-postgresql")
optional("org.flywaydb:flyway-sqlserver")
optional("org.testcontainers:jdbc")
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:postgresql")
dockerTestRuntimeOnly("org.postgresql:postgresql")
testImplementation(project(":spring-boot-project:spring-boot-jooq"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.flyway;
package org.springframework.boot.flyway.testcontainers;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.Test;
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
</configuration>
@@ -0,0 +1 @@
spring.test.context.cache.maxSize=1
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.flyway;
package org.springframework.boot.flyway.testcontainers;
import org.testcontainers.containers.JdbcDatabaseContainer;
@@ -17,4 +17,4 @@
/**
* Support for testcontainers Flyway service connections.
*/
package org.springframework.boot.testcontainers.service.connection.flyway;
package org.springframework.boot.flyway.testcontainers;
@@ -1,3 +1,7 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.flyway.testcontainers.FlywayContainerConnectionDetailsFactory
# Database Initializer Detectors
org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\
org.springframework.boot.flyway.FlywayDatabaseInitializerDetector,\
@@ -28,7 +28,6 @@ dependencies {
api(project(":spring-boot-project:spring-boot-autoconfigure"))
api(project(":spring-boot-project:spring-boot-testcontainers"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-flyway"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-jdbc"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-kafka"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-liquibase"))
@@ -60,12 +59,10 @@ dependencies {
dockerTestRuntimeOnly("com.oracle.database.r2dbc:oracle-r2dbc")
dockerTestRuntimeOnly("com.zaxxer:HikariCP")
dockerTestRuntimeOnly("io.lettuce:lettuce-core")
dockerTestRuntimeOnly("org.flywaydb:flyway-database-postgresql")
dockerTestRuntimeOnly("org.postgresql:postgresql")
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
optional(project(":spring-boot-project:spring-boot-data-redis"))
optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-hazelcast"))
optional(project(":spring-boot-project:spring-boot-jdbc"))
optional(project(":spring-boot-project:spring-boot-kafka"))
@@ -1,6 +1,5 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.testcontainers.service.connection.flyway.FlywayContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.hazelcast.HazelcastContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.kafka.ApacheKafkaContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.kafka.ConfluentKafkaContainerConnectionDetailsFactory,\