Move Hazelcast testcontainers support into spring-boot-hazelcast

See gh-46099
This commit is contained in:
Stéphane Nicoll 2025-05-19 15:57:38 +02:00 committed by Andy Wilkinson
parent 5528d1fbfe
commit e29c46388d
11 changed files with 21 additions and 7 deletions

View File

@ -20,6 +20,7 @@ plugins {
id "org.springframework.boot.auto-configuration" id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties" id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed" id "org.springframework.boot.deployed"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.optional-dependencies" id "org.springframework.boot.optional-dependencies"
} }
@ -34,12 +35,19 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-jpa")) optional(project(":spring-boot-project:spring-boot-jpa"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("com.hazelcast:hazelcast-spring") optional("com.hazelcast:hazelcast-spring")
optional("org.slf4j:slf4j-api") 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") testCompileOnly("com.fasterxml.jackson.core:jackson-annotations")
testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) 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("com.h2database:h2")
testRuntimeOnly("ch.qos.logback:logback-classic") testRuntimeOnly("ch.qos.logback:logback-classic")

View File

@ -14,7 +14,7 @@
* limitations under the License. * 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.UUID;
import java.util.function.Consumer; import java.util.function.Consumer;

View File

@ -14,7 +14,7 @@
* limitations under the License. * 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.UUID;

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. * limitations under the License.
*/ */
package org.springframework.boot.testcontainers.service.connection.hazelcast; package org.springframework.boot.hazelcast.testcontainers;
import java.util.Map; import java.util.Map;

View File

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

View File

@ -0,0 +1,3 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.hazelcast.testcontainers.HazelcastContainerConnectionDetailsFactory

View File

@ -14,7 +14,7 @@
* limitations under the License. * 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 com.hazelcast.client.config.ClientConfig;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@ -59,7 +59,6 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all")) 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-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-jdbc"))
optional(project(":spring-boot-project:spring-boot-kafka")) optional(project(":spring-boot-project:spring-boot-kafka"))
optional(project(":spring-boot-project:spring-boot-ldap")) optional(project(":spring-boot-project:spring-boot-ldap"))

View File

@ -1,6 +1,5 @@
# Connection Details Factories # Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\ 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.ApacheKafkaContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.kafka.ConfluentKafkaContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.kafka.ConfluentKafkaContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.kafka.DeprecatedConfluentKafkaContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.kafka.DeprecatedConfluentKafkaContainerConnectionDetailsFactory,\