Move code out of testcontainers-all into relevant modules

This commit is contained in:
Andy Wilkinson
2025-06-06 15:45:51 +01:00
committed by Phillip Webb
parent fb886a1818
commit 183a0fbdf5
30 changed files with 95 additions and 86 deletions

View File

@@ -130,7 +130,6 @@ include "spring-boot-project:spring-boot-sql"
include "spring-boot-project:spring-boot-test"
include "spring-boot-project:spring-boot-test-autoconfigure"
include "spring-boot-project:spring-boot-testcontainers"
include "spring-boot-project:spring-boot-testcontainers-all"
include "spring-boot-project:spring-boot-thymeleaf"
include "spring-boot-project:spring-boot-tomcat"
include "spring-boot-project:spring-boot-tools:spring-boot-antlib"

View File

@@ -2124,7 +2124,6 @@ bom {
"spring-boot-test",
"spring-boot-test-autoconfigure",
"spring-boot-testcontainers",
"spring-boot-testcontainers-all",
"spring-boot-thymeleaf",
"spring-boot-tomcat",
"spring-boot-tracing",

View File

@@ -258,7 +258,7 @@ dependencies {
implementation(project(path: ":spring-boot-project:spring-boot-security"))
implementation(project(path: ":spring-boot-project:spring-boot-test"))
implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure"))
implementation(project(path: ":spring-boot-project:spring-boot-testcontainers-all"))
implementation(project(path: ":spring-boot-project:spring-boot-testcontainers"))
implementation(project(path: ":spring-boot-project:spring-boot-tomcat"))
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli"))
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))

View File

@@ -4,6 +4,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,6 +18,7 @@ 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-opentelemetry"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("ch.qos.logback:logback-classic")
optional("io.micrometer:micrometer-java21")
optional("io.micrometer:micrometer-registry-appoptics")
@@ -43,6 +45,11 @@ dependencies {
optional("org.apache.kafka:kafka-streams")
optional("org.apache.logging.log4j:log4j-core")
optional("org.aspectj:aspectjweaver")
optional("org.testcontainers:grafana")
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("io.rest-assured:rest-assured")
dockerTestImplementation("org.testcontainers:junit-jupiter")
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
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.otlp;
package org.springframework.boot.metrics.testcontainers.otlp;
import org.testcontainers.grafana.LgtmStackContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.metrics.testcontainers.otlp;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;

View File

@@ -15,6 +15,6 @@
*/
/**
* Support for testcontainers OpenTelemetry service connections.
* Support for Testcontainers OpenTelemetry metrics service connections.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.metrics.testcontainers.otlp;

View File

@@ -1,3 +1,8 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.metrics.testcontainers.otlp.GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory,\
org.springframework.boot.metrics.testcontainers.otlp.OpenTelemetryMetricsContainerConnectionDetailsFactory
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.metrics.ValidationFailureAnalyzer

View File

@@ -16,7 +16,12 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("io.opentelemetry:opentelemetry-exporter-otlp")
optional("org.testcontainers:grafana")
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("org.testcontainers:junit-jupiter")
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.otlp;
package org.springframework.boot.opentelemetry.testcontainers;
import org.junit.jupiter.api.Test;
import org.testcontainers.grafana.LgtmStackContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.opentelemetry.testcontainers;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
@@ -24,10 +24,10 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.OpenTelemetryLoggingConnectionDetails;
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.OpenTelemetryLoggingExportAutoConfiguration;
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.Transport;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.boot.tracing.autoconfigure.otlp.OtlpTracingAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -59,7 +59,7 @@ class OpenTelemetryLoggingContainerConnectionDetailsFactoryIntegrationTests {
}
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration(OtlpTracingAutoConfiguration.class)
@ImportAutoConfiguration(OpenTelemetryLoggingExportAutoConfiguration.class)
static class TestConfiguration {
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.opentelemetry.testcontainers;
import org.testcontainers.grafana.LgtmStackContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.opentelemetry.testcontainers;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Support for Testcontainers OpenTelemetry logging service connections.
*/
package org.springframework.boot.opentelemetry.testcontainers;

View File

@@ -0,0 +1,4 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.opentelemetry.testcontainers.GrafanaOpenTelemetryLoggingContainerConnectionDetailsFactory,\
org.springframework.boot.opentelemetry.testcontainers.OpenTelemetryLoggingContainerConnectionDetailsFactory

View File

@@ -23,7 +23,7 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-data-mongodb"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-docker-compose"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-docker-compose-all"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tx"))
dockerTestImplementation("com.zaxxer:HikariCP")
@@ -134,7 +134,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-gson"))
testImplementation(project(":spring-boot-project:spring-boot-mustache"))
testImplementation(project(":spring-boot-project:spring-boot-reactor"))
testImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
testImplementation(project(":spring-boot-project:spring-boot-thymeleaf"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("ch.qos.logback:logback-classic")

View File

@@ -1,49 +0,0 @@
plugins {
id "java-library"
id "org.springframework.boot.deployed"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Testcontainers Support All"
dependencies {
api(project(":spring-boot-project:spring-boot-autoconfigure"))
api(project(":spring-boot-project:spring-boot-testcontainers"))
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-tx"))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers")))
dockerTestImplementation("ch.qos.logback:logback-classic")
dockerTestImplementation("io.micrometer:micrometer-registry-otlp")
dockerTestImplementation("io.rest-assured:rest-assured")
dockerTestImplementation("org.assertj:assertj-core")
dockerTestImplementation("org.awaitility:awaitility")
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
dockerTestImplementation("org.junit.platform:junit-platform-launcher")
dockerTestImplementation("org.mockito:mockito-core")
dockerTestImplementation("org.springframework:spring-core-test")
dockerTestImplementation("org.testcontainers:junit-jupiter")
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
optional(project(":spring-boot-project:spring-boot-metrics"))
optional(project(":spring-boot-project:spring-boot-opentelemetry"))
optional(project(":spring-boot-project:spring-boot-tracing"))
optional(project(":spring-boot-project:spring-boot-tx"))
optional(project(":spring-boot-project:spring-boot-zipkin"))
optional("org.springframework:spring-test")
optional("org.testcontainers:grafana")
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")))
testImplementation("org.springframework:spring-jdbc")
testImplementation("org.testcontainers:junit-jupiter")
}
javadoc.enabled = false
dockerTest {
jvmArgs += "--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
}

View File

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

View File

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

View File

@@ -1,8 +0,0 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelemetryLoggingContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryLoggingContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryMetricsContainerConnectionDetailsFactory,\
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryTracingContainerConnectionDetailsFactory

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"
}
@@ -18,6 +19,7 @@ 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-metrics"))
optional(project(":spring-boot-project:spring-boot-testcontainers"))
optional("io.micrometer:micrometer-core")
optional("io.micrometer:micrometer-tracing-bridge-brave")
optional("io.micrometer:micrometer-tracing-bridge-otel")
@@ -27,6 +29,10 @@ dependencies {
optional("io.zipkin.reporter2:zipkin-reporter-brave")
optional("org.aspectj:aspectjweaver")
optional("org.junit.platform:junit-platform-launcher")
optional("org.testcontainers:grafana")
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("org.testcontainers:junit-jupiter")
testImplementation(project(":spring-boot-project:spring-boot-opentelemetry"))
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.otlp;
package org.springframework.boot.tracing.testcontainers.otlp;
import org.junit.jupiter.api.Test;
import org.testcontainers.grafana.LgtmStackContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.tracing.testcontainers.otlp;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.tracing.testcontainers.otlp;
import org.testcontainers.grafana.LgtmStackContainer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.testcontainers.service.connection.otlp;
package org.springframework.boot.tracing.testcontainers.otlp;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Support for Testcontainers OpenTelemetry tracing service connections.
*/
package org.springframework.boot.tracing.testcontainers.otlp;

View File

@@ -1,7 +1,13 @@
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.tracing.autoconfigure.LogCorrelationEnvironmentPostProcessor
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.tracing.testcontainers.otlp.GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory,\
org.springframework.boot.tracing.testcontainers.otlp.OpenTelemetryTracingContainerConnectionDetailsFactory
# Application Listeners
org.springframework.context.ApplicationListener=\
org.springframework.boot.tracing.autoconfigure.OpenTelemetryEventPublisherBeansApplicationListener
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.tracing.autoconfigure.LogCorrelationEnvironmentPostProcessor