Skip to content

Commit 5a2f3f4

Browse files
committed
Move code out of testcontainers-all into relevant modules
1 parent 717d1d2 commit 5a2f3f4

File tree

30 files changed

+95
-86
lines changed

30 files changed

+95
-86
lines changed

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ include "spring-boot-project:spring-boot-sql"
130130
include "spring-boot-project:spring-boot-test"
131131
include "spring-boot-project:spring-boot-test-autoconfigure"
132132
include "spring-boot-project:spring-boot-testcontainers"
133-
include "spring-boot-project:spring-boot-testcontainers-all"
134133
include "spring-boot-project:spring-boot-thymeleaf"
135134
include "spring-boot-project:spring-boot-tomcat"
136135
include "spring-boot-project:spring-boot-tools:spring-boot-antlib"

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,6 @@ bom {
21242124
"spring-boot-test",
21252125
"spring-boot-test-autoconfigure",
21262126
"spring-boot-testcontainers",
2127-
"spring-boot-testcontainers-all",
21282127
"spring-boot-thymeleaf",
21292128
"spring-boot-tomcat",
21302129
"spring-boot-tracing",

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ dependencies {
258258
implementation(project(path: ":spring-boot-project:spring-boot-security"))
259259
implementation(project(path: ":spring-boot-project:spring-boot-test"))
260260
implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure"))
261-
implementation(project(path: ":spring-boot-project:spring-boot-testcontainers-all"))
261+
implementation(project(path: ":spring-boot-project:spring-boot-testcontainers"))
262262
implementation(project(path: ":spring-boot-project:spring-boot-tomcat"))
263263
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli"))
264264
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))

spring-boot-project/spring-boot-metrics/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id "org.springframework.boot.auto-configuration"
55
id "org.springframework.boot.configuration-properties"
66
id "org.springframework.boot.deployed"
7+
id "org.springframework.boot.docker-test"
78
id "org.springframework.boot.optional-dependencies"
89
}
910

@@ -17,6 +18,7 @@ dependencies {
1718
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
1819
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
1920
optional(project(":spring-boot-project:spring-boot-opentelemetry"))
21+
optional(project(":spring-boot-project:spring-boot-testcontainers"))
2022
optional("ch.qos.logback:logback-classic")
2123
optional("io.micrometer:micrometer-java21")
2224
optional("io.micrometer:micrometer-registry-appoptics")
@@ -43,6 +45,11 @@ dependencies {
4345
optional("org.apache.kafka:kafka-streams")
4446
optional("org.apache.logging.log4j:log4j-core")
4547
optional("org.aspectj:aspectjweaver")
48+
optional("org.testcontainers:grafana")
49+
50+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
51+
dockerTestImplementation("io.rest-assured:rest-assured")
52+
dockerTestImplementation("org.testcontainers:junit-jupiter")
4653

4754
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
4855
testImplementation(project(":spring-boot-project:spring-boot-test"))
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.metrics.testcontainers.otlp;
1818

1919
import java.time.Duration;
2020

Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.metrics.testcontainers.otlp;
1818

1919
import java.time.Duration;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.metrics.testcontainers.otlp;
1818

1919
import org.testcontainers.grafana.LgtmStackContainer;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.metrics.testcontainers.otlp;
1818

1919
import org.testcontainers.containers.Container;
2020
import org.testcontainers.containers.GenericContainer;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616

1717
/**
18-
* Support for testcontainers OpenTelemetry service connections.
18+
* Support for Testcontainers OpenTelemetry metrics service connections.
1919
*/
20-
package org.springframework.boot.testcontainers.service.connection.otlp;
20+
package org.springframework.boot.metrics.testcontainers.otlp;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Connection Details Factories
2+
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
3+
org.springframework.boot.metrics.testcontainers.otlp.GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory,\
4+
org.springframework.boot.metrics.testcontainers.otlp.OpenTelemetryMetricsContainerConnectionDetailsFactory
5+
16
# Failure Analyzers
27
org.springframework.boot.diagnostics.FailureAnalyzer=\
38
org.springframework.boot.metrics.ValidationFailureAnalyzer

spring-boot-project/spring-boot-opentelemetry/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ dependencies {
1616

1717
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
1818
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
19+
optional(project(":spring-boot-project:spring-boot-testcontainers"))
1920
optional("io.opentelemetry:opentelemetry-exporter-otlp")
21+
optional("org.testcontainers:grafana")
22+
23+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
24+
dockerTestImplementation("org.testcontainers:junit-jupiter")
2025

2126
testImplementation(project(":spring-boot-project:spring-boot-test"))
2227
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.opentelemetry.testcontainers;
1818

1919
import org.junit.jupiter.api.Test;
2020
import org.testcontainers.grafana.LgtmStackContainer;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.opentelemetry.testcontainers;
1818

1919
import org.junit.jupiter.api.Test;
2020
import org.testcontainers.containers.GenericContainer;
@@ -24,10 +24,10 @@
2424
import org.springframework.beans.factory.annotation.Autowired;
2525
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2626
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.OpenTelemetryLoggingConnectionDetails;
27+
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.OpenTelemetryLoggingExportAutoConfiguration;
2728
import org.springframework.boot.opentelemetry.actuate.autoconfigure.logging.Transport;
2829
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
2930
import org.springframework.boot.testsupport.container.TestImage;
30-
import org.springframework.boot.tracing.autoconfigure.otlp.OtlpTracingAutoConfiguration;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3333

@@ -59,7 +59,7 @@ void connectionCanBeMadeToOpenTelemetryContainer() {
5959
}
6060

6161
@Configuration(proxyBeanMethods = false)
62-
@ImportAutoConfiguration(OtlpTracingAutoConfiguration.class)
62+
@ImportAutoConfiguration(OpenTelemetryLoggingExportAutoConfiguration.class)
6363
static class TestConfiguration {
6464

6565
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.opentelemetry.testcontainers;
1818

1919
import org.testcontainers.grafana.LgtmStackContainer;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.opentelemetry.testcontainers;
1818

1919
import org.testcontainers.containers.Container;
2020
import org.testcontainers.containers.GenericContainer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Support for Testcontainers OpenTelemetry logging service connections.
19+
*/
20+
package org.springframework.boot.opentelemetry.testcontainers;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Connection Details Factories
2+
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
3+
org.springframework.boot.opentelemetry.testcontainers.GrafanaOpenTelemetryLoggingContainerConnectionDetailsFactory,\
4+
org.springframework.boot.opentelemetry.testcontainers.OpenTelemetryLoggingContainerConnectionDetailsFactory

spring-boot-project/spring-boot-test-autoconfigure/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323
dockerTestImplementation(project(":spring-boot-project:spring-boot-data-mongodb"))
2424
dockerTestImplementation(project(":spring-boot-project:spring-boot-docker-compose"))
2525
dockerTestImplementation(project(":spring-boot-project:spring-boot-docker-compose-all"))
26-
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
26+
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
2727
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
2828
dockerTestImplementation(project(":spring-boot-project:spring-boot-tx"))
2929
dockerTestImplementation("com.zaxxer:HikariCP")
@@ -134,7 +134,7 @@ dependencies {
134134
testImplementation(project(":spring-boot-project:spring-boot-gson"))
135135
testImplementation(project(":spring-boot-project:spring-boot-mustache"))
136136
testImplementation(project(":spring-boot-project:spring-boot-reactor"))
137-
testImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
137+
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
138138
testImplementation(project(":spring-boot-project:spring-boot-thymeleaf"))
139139
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
140140
testImplementation("ch.qos.logback:logback-classic")

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/resources/logback-test.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

spring-boot-project/spring-boot-testcontainers-all/src/dockerTest/resources/spring.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

spring-boot-project/spring-boot-testcontainers-all/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 8 deletions
This file was deleted.

spring-boot-project/spring-boot-tracing/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id "org.springframework.boot.auto-configuration"
44
id "org.springframework.boot.configuration-properties"
55
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.docker-test"
67
id "org.springframework.boot.optional-dependencies"
78
}
89

@@ -18,6 +19,7 @@ dependencies {
1819
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
1920
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
2021
optional(project(":spring-boot-project:spring-boot-metrics"))
22+
optional(project(":spring-boot-project:spring-boot-testcontainers"))
2123
optional("io.micrometer:micrometer-core")
2224
optional("io.micrometer:micrometer-tracing-bridge-brave")
2325
optional("io.micrometer:micrometer-tracing-bridge-otel")
@@ -27,6 +29,10 @@ dependencies {
2729
optional("io.zipkin.reporter2:zipkin-reporter-brave")
2830
optional("org.aspectj:aspectjweaver")
2931
optional("org.junit.platform:junit-platform-launcher")
32+
optional("org.testcontainers:grafana")
33+
34+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
35+
dockerTestImplementation("org.testcontainers:junit-jupiter")
3036

3137
testImplementation(project(":spring-boot-project:spring-boot-opentelemetry"))
3238
testImplementation(project(":spring-boot-project:spring-boot-test"))
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.tracing.testcontainers.otlp;
1818

1919
import org.junit.jupiter.api.Test;
2020
import org.testcontainers.grafana.LgtmStackContainer;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.tracing.testcontainers.otlp;
1818

1919
import org.junit.jupiter.api.Test;
2020
import org.testcontainers.containers.GenericContainer;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.tracing.testcontainers.otlp;
1818

1919
import org.testcontainers.grafana.LgtmStackContainer;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.testcontainers.service.connection.otlp;
17+
package org.springframework.boot.tracing.testcontainers.otlp;
1818

1919
import org.testcontainers.containers.Container;
2020
import org.testcontainers.containers.GenericContainer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Support for Testcontainers OpenTelemetry tracing service connections.
19+
*/
20+
package org.springframework.boot.tracing.testcontainers.otlp;
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# Environment Post Processors
2-
org.springframework.boot.env.EnvironmentPostProcessor=\
3-
org.springframework.boot.tracing.autoconfigure.LogCorrelationEnvironmentPostProcessor
1+
# Connection Details Factories
2+
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
3+
org.springframework.boot.tracing.testcontainers.otlp.GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory,\
4+
org.springframework.boot.tracing.testcontainers.otlp.OpenTelemetryTracingContainerConnectionDetailsFactory
45

56
# Application Listeners
67
org.springframework.context.ApplicationListener=\
78
org.springframework.boot.tracing.autoconfigure.OpenTelemetryEventPublisherBeansApplicationListener
9+
10+
# Environment Post Processors
11+
org.springframework.boot.env.EnvironmentPostProcessor=\
12+
org.springframework.boot.tracing.autoconfigure.LogCorrelationEnvironmentPostProcessor
13+

0 commit comments

Comments
 (0)