Browse Source

Move Flyway testcontainers support into spring-boot-flyway

See gh-46086
pull/46230/head
Stéphane Nicoll 7 months ago committed by Andy Wilkinson
parent
commit
ac16a7919b
  1. 9
      spring-boot-project/spring-boot-flyway/build.gradle
  2. 2
      spring-boot-project/spring-boot-flyway/src/dockerTest/java/org/springframework/boot/flyway/testcontainers/FlywayContainerConnectionDetailsFactoryTests.java
  3. 4
      spring-boot-project/spring-boot-flyway/src/dockerTest/resources/logback-test.xml
  4. 1
      spring-boot-project/spring-boot-flyway/src/dockerTest/resources/spring.properties
  5. 2
      spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/testcontainers/FlywayContainerConnectionDetailsFactory.java
  6. 2
      spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/testcontainers/package-info.java
  7. 4
      spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories
  8. 3
      spring-boot-project/spring-boot-testcontainers-all/build.gradle
  9. 1
      spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories

9
spring-boot-project/spring-boot-flyway/build.gradle

@ -20,6 +20,7 @@ plugins { @@ -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 { @@ -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"))

2
spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactoryTests.java → spring-boot-project/spring-boot-flyway/src/dockerTest/java/org/springframework/boot/flyway/testcontainers/FlywayContainerConnectionDetailsFactoryTests.java

@ -14,7 +14,7 @@ @@ -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;

4
spring-boot-project/spring-boot-flyway/src/dockerTest/resources/logback-test.xml

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

1
spring-boot-project/spring-boot-flyway/src/dockerTest/resources/spring.properties

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

2
spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactory.java → spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/testcontainers/FlywayContainerConnectionDetailsFactory.java

@ -14,7 +14,7 @@ @@ -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;

2
spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/package-info.java → spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/testcontainers/package-info.java

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

4
spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories

@ -1,3 +1,7 @@ @@ -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,\

3
spring-boot-project/spring-boot-testcontainers-all/build.gradle

@ -28,7 +28,6 @@ dependencies { @@ -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 { @@ -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
spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories

@ -1,6 +1,5 @@ @@ -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,\

Loading…
Cancel
Save