Skip to content

Commit 08bc046

Browse files
Document usage of Docker Compose support in tests
Closes gh-40171
1 parent 3a9ee9f commit 08bc046

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Diff for: spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/docker-compose.adoc

+20-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ When this module is included as a dependency Spring Boot will do the following:
3838
If the Docker Compose services are already running when starting the application, Spring Boot will only create the service connection beans for each supported container.
3939
It will not call `docker compose up` again and it will not call `docker compose stop` when the application is shutdown.
4040

41-
NOTE: By default, Spring Boot's Docker Compose support is disabled when running tests.
42-
To enable it, set configprop:spring.docker.compose.skip.in-tests[] to `false`.
43-
4441

4542

4643
[[features.docker-compose.prerequisites]]
@@ -256,3 +253,23 @@ If you want to activate a specific Docker Compose profile you can use the config
256253
profiles:
257254
active: "myprofile"
258255
----
256+
257+
258+
259+
[[features.docker-compose.tests]]
260+
=== Using Docker Compose in Tests
261+
262+
By default, Spring Boot's Docker Compose support is disabled when running tests.
263+
264+
To enable Docker Compose support in tests, set configprop:spring.docker.compose.skip.in-tests[] to `false`.
265+
266+
When using Gradle, you also need to change the configuration of the `spring-boot-docker-compose` dependency from `developmentOnly` to `testAndDevelopmentOnly`:
267+
268+
.Gradle
269+
[source,gradle,indent=0,subs="verbatim"]
270+
----
271+
dependencies {
272+
testAndDevelopmentOnly("org.springframework.boot:spring-boot-docker-compose")
273+
}
274+
----
275+

0 commit comments

Comments
 (0)