Move Flyway testcontainers support into spring-boot-flyway

This commit is contained in:
Stéphane Nicoll
2025-05-19 15:41:29 +02:00
committed by Phillip Webb
parent 9d531caa52
commit 400a1c96ae
9 changed files with 21 additions and 7 deletions

View File

@@ -3,6 +3,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"
}
@@ -15,9 +16,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"))

View File

@@ -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;

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
</configuration>

View File

@@ -0,0 +1 @@
spring.test.context.cache.maxSize=1

View File

@@ -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;

View File

@@ -17,4 +17,4 @@
/**
* Support for testcontainers Flyway service connections.
*/
package org.springframework.boot.testcontainers.service.connection.flyway;
package org.springframework.boot.flyway.testcontainers;

View File

@@ -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,\

View File

@@ -11,7 +11,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"))
@@ -43,12 +42,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"))

View File

@@ -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,\