Move Elasticsearch testcontainers support into spring-boot-elasticsearch

Issue: 46091
This commit is contained in:
Stéphane Nicoll 2025-05-19 15:19:07 +02:00 committed by Phillip Webb
parent 31cbcc6f67
commit d1b1f1d0e2
10 changed files with 14 additions and 9 deletions

View File

@ -34,6 +34,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-jsonb"))
optional(project(":spring-boot-project:spring-boot-reactor"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("co.elastic.clients:elasticsearch-java") {
exclude group: "commons-logging", module: "commons-logging"
}
@ -45,13 +46,13 @@ dependencies {
optional("org.springframework.data:spring-data-elasticsearch") {
exclude group: "org.elasticsearch.client", module: "transport"
}
optional("org.testcontainers:elasticsearch")
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-jackson"))
dockerTestImplementation("org.testcontainers:elasticsearch")
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:testcontainers")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.elasticsearch;
package org.springframework.boot.elasticsearch.testcontainers;
import java.io.IOException;
import java.time.Duration;

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.elasticsearch;
package org.springframework.boot.elasticsearch.testcontainers;
import java.io.ByteArrayInputStream;
import java.io.IOException;

View File

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

View File

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

View File

@ -39,7 +39,6 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-tx"))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers")))
dockerTestImplementation("ch.qos.logback:logback-classic")
dockerTestImplementation("co.elastic.clients:elasticsearch-java")
dockerTestImplementation("io.micrometer:micrometer-registry-otlp")
dockerTestImplementation("io.rest-assured:rest-assured")
dockerTestImplementation("org.assertj:assertj-core")
@ -66,7 +65,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-elasticsearch"))
optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-hazelcast"))
optional(project(":spring-boot-project:spring-boot-jdbc"))
@ -82,7 +80,6 @@ dependencies {
optional("org.springframework.data:spring-data-mongodb")
optional("org.springframework.data:spring-data-neo4j")
optional("org.testcontainers:clickhouse")
optional("org.testcontainers:elasticsearch")
optional("org.testcontainers:grafana")
optional("org.testcontainers:jdbc")
optional("org.testcontainers:kafka")

View File

@ -1,6 +1,5 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.flyway.FlywayContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.hazelcast.HazelcastContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.jdbc.JdbcContainerConnectionDetailsFactory,\

View File

@ -26,7 +26,7 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
dockerTestImplementation("org.junit.platform:junit-platform-engine")
dockerTestImplementation("org.junit.platform:junit-platform-launcher")