Skip to content

Commit 3f1f801

Browse files
committed
Update spring-boot-testcontainers to use docker-test plugin
See gh-41228
1 parent d78c7b5 commit 3f1f801

File tree

32 files changed

+197
-124
lines changed

32 files changed

+197
-124
lines changed

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

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

@@ -13,14 +14,50 @@ dependencies {
1314
api(project(":spring-boot-project:spring-boot-autoconfigure"))
1415
api("org.testcontainers:testcontainers")
1516

17+
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
18+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
19+
dockerTestImplementation("ch.qos.logback:logback-classic")
20+
dockerTestImplementation("co.elastic.clients:elasticsearch-java") {
21+
exclude group: "commons-logging", module: "commons-logging"
22+
}
23+
dockerTestImplementation("com.couchbase.client:java-client")
24+
dockerTestImplementation("com.datastax.oss:java-driver-core")
25+
dockerTestImplementation("io.micrometer:micrometer-registry-otlp")
26+
dockerTestImplementation("io.rest-assured:rest-assured") {
27+
exclude group: "commons-logging", module: "commons-logging"
28+
}
29+
dockerTestImplementation("org.apache.activemq:activemq-client-jakarta")
30+
dockerTestImplementation("org.assertj:assertj-core")
31+
dockerTestImplementation("org.awaitility:awaitility")
32+
dockerTestImplementation("org.flywaydb:flyway-core")
33+
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
34+
dockerTestImplementation("org.junit.platform:junit-platform-launcher")
35+
dockerTestImplementation("org.liquibase:liquibase-core") {
36+
exclude(group: "javax.xml.bind", module: "jaxb-api")
37+
}
38+
dockerTestImplementation("org.mockito:mockito-core")
39+
dockerTestImplementation("org.springframework:spring-core-test")
40+
dockerTestImplementation("org.springframework:spring-jdbc")
41+
dockerTestImplementation("org.springframework:spring-jms")
42+
dockerTestImplementation("org.springframework:spring-r2dbc")
43+
dockerTestImplementation("org.springframework.amqp:spring-rabbit")
44+
dockerTestImplementation("org.springframework.data:spring-data-redis")
45+
dockerTestImplementation("org.springframework.kafka:spring-kafka")
46+
dockerTestImplementation("org.springframework.pulsar:spring-pulsar")
47+
dockerTestImplementation("org.testcontainers:junit-jupiter")
48+
49+
dockerTestRuntimeOnly("com.oracle.database.r2dbc:oracle-r2dbc")
50+
dockerTestRuntimeOnly("com.zaxxer:HikariCP")
51+
dockerTestRuntimeOnly("io.lettuce:lettuce-core")
52+
dockerTestRuntimeOnly("org.postgresql:postgresql")
53+
1654
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
1755
optional("org.springframework:spring-test")
1856
optional("org.springframework.data:spring-data-mongodb")
1957
optional("org.springframework.data:spring-data-neo4j")
2058
optional("org.testcontainers:cassandra")
2159
optional("org.testcontainers:couchbase")
2260
optional("org.testcontainers:elasticsearch")
23-
optional("org.testcontainers:influxdb")
2461
optional("org.testcontainers:jdbc")
2562
optional("org.testcontainers:kafka")
2663
optional("org.testcontainers:mariadb")
@@ -36,43 +73,9 @@ dependencies {
3673
optional("org.testcontainers:redpanda")
3774
optional("org.testcontainers:r2dbc")
3875

39-
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
4076
testImplementation(project(":spring-boot-project:spring-boot-test"))
41-
testImplementation("ch.qos.logback:logback-classic")
42-
testImplementation("co.elastic.clients:elasticsearch-java") {
43-
exclude group: "commons-logging", module: "commons-logging"
44-
}
45-
testImplementation("com.couchbase.client:java-client")
46-
testImplementation("com.datastax.oss:java-driver-core")
47-
testImplementation("io.micrometer:micrometer-registry-otlp")
48-
testImplementation("io.rest-assured:rest-assured") {
49-
exclude group: "commons-logging", module: "commons-logging"
50-
}
51-
testImplementation("org.apache.activemq:activemq-client-jakarta")
77+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
5278
testImplementation("org.assertj:assertj-core")
53-
testImplementation("org.awaitility:awaitility")
54-
testImplementation("org.flywaydb:flyway-core")
55-
testImplementation("org.influxdb:influxdb-java")
5679
testImplementation("org.junit.jupiter:junit-jupiter")
57-
testImplementation("org.junit.platform:junit-platform-engine")
58-
testImplementation("org.junit.platform:junit-platform-launcher")
59-
testImplementation("org.liquibase:liquibase-core") {
60-
exclude(group: "javax.xml.bind", module: "jaxb-api")
61-
}
6280
testImplementation("org.mockito:mockito-core")
63-
testImplementation("org.mockito:mockito-junit-jupiter")
64-
testImplementation("org.springframework:spring-core-test")
65-
testImplementation("org.springframework:spring-jdbc")
66-
testImplementation("org.springframework:spring-jms")
67-
testImplementation("org.springframework:spring-r2dbc")
68-
testImplementation("org.springframework.amqp:spring-rabbit")
69-
testImplementation("org.springframework.data:spring-data-redis")
70-
testImplementation("org.springframework.kafka:spring-kafka")
71-
testImplementation("org.springframework.pulsar:spring-pulsar")
72-
testImplementation("org.testcontainers:junit-jupiter")
73-
74-
testRuntimeOnly("com.oracle.database.r2dbc:oracle-r2dbc")
75-
testRuntimeOnly("com.zaxxer:HikariCP")
76-
testRuntimeOnly("io.lettuce:lettuce-core")
77-
testRuntimeOnly("org.postgresql:postgresql")
7881
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
import org.springframework.test.context.junit.jupiter.SpringExtension;
3737

3838
/**
39+
* Tests for {@link ImportTestcontainers} when properties are being injected into a
40+
* {@link LoadTimeWeaverAware} bean.
41+
*
3942
* @author Phillip Webb
4043
*/
4144
@ExtendWith(SpringExtension.class)

0 commit comments

Comments
 (0)