diff --git a/spring-boot-project/spring-boot-hazelcast/build.gradle b/spring-boot-project/spring-boot-hazelcast/build.gradle index 5c1cb2f365..9402b38631 100644 --- a/spring-boot-project/spring-boot-hazelcast/build.gradle +++ b/spring-boot-project/spring-boot-hazelcast/build.gradle @@ -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" } @@ -17,12 +18,19 @@ 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-jpa")) + optional(project(":spring-boot-project:spring-boot-testcontainers")) optional("com.hazelcast:hazelcast-spring") optional("org.slf4j:slf4j-api") + 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") + testCompileOnly("com.fasterxml.jackson.core:jackson-annotations") + testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers"))) testRuntimeOnly("com.h2database:h2") testRuntimeOnly("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java similarity index 97% rename from spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java rename to spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java index 553fd4840c..870d7d9ba0 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.testcontainers.service.connection.hazelcast; +package org.springframework.boot.hazelcast.testcontainers; import java.util.UUID; import java.util.function.Consumer; diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java similarity index 97% rename from spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java rename to spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java index 183aae5ae7..ccbe572b60 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.testcontainers.service.connection.hazelcast; +package org.springframework.boot.hazelcast.testcontainers; import java.util.UUID; diff --git a/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/logback-test.xml b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/logback-test.xml new file mode 100644 index 0000000000..b8a41480d7 --- /dev/null +++ b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/logback-test.xml @@ -0,0 +1,4 @@ + + + + diff --git a/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/spring.properties b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/spring.properties new file mode 100644 index 0000000000..47dff33f0b --- /dev/null +++ b/spring-boot-project/spring-boot-hazelcast/src/dockerTest/resources/spring.properties @@ -0,0 +1 @@ +spring.test.context.cache.maxSize=1 \ No newline at end of file diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactory.java similarity index 97% rename from spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactory.java index c845da1a27..4e770a4220 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.testcontainers.service.connection.hazelcast; +package org.springframework.boot.hazelcast.testcontainers; import java.util.Map; diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/package-info.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/package-info.java similarity index 89% rename from spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/package-info.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/package-info.java index b9703c9b18..5d20053b33 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/package-info.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/testcontainers/package-info.java @@ -17,4 +17,4 @@ /** * Support for testcontainers Hazelcast service connections. */ -package org.springframework.boot.testcontainers.service.connection.hazelcast; +package org.springframework.boot.hazelcast.testcontainers; diff --git a/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..836eee4400 --- /dev/null +++ b/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +# Connection Details Factories +org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\ +org.springframework.boot.hazelcast.testcontainers.HazelcastContainerConnectionDetailsFactory diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/test/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryTests.java similarity index 94% rename from spring-boot-project/spring-boot-testcontainers-all/src/test/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryTests.java index 7f580e7f46..4b7342e9be 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/test/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/testcontainers/HazelcastContainerConnectionDetailsFactoryTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.testcontainers.service.connection.hazelcast; +package org.springframework.boot.hazelcast.testcontainers; import com.hazelcast.client.config.ClientConfig; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-testcontainers-all/build.gradle b/spring-boot-project/spring-boot-testcontainers-all/build.gradle index c1a09a9bb3..5ec1d8ecde 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers-all/build.gradle @@ -42,7 +42,6 @@ dependencies { 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-hazelcast")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-kafka")) optional(project(":spring-boot-project:spring-boot-ldap")) diff --git a/spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories index ec74efa060..36959dda12 100644 --- a/spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories @@ -1,6 +1,5 @@ # Connection Details Factories org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\ -org.springframework.boot.testcontainers.service.connection.hazelcast.HazelcastContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.kafka.ApacheKafkaContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.kafka.ConfluentKafkaContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.kafka.DeprecatedConfluentKafkaContainerConnectionDetailsFactory,\