Skip to content

Commit 3356aa0

Browse files
committed
Improve formatting according to the requirements in Wiki
Concretely I have ensured that there are three lines between text and next header. Also I added anchors to each header Signed-off-by: Vanio Begic <[email protected]>
1 parent 092e4ca commit 3356aa0

File tree

1 file changed

+10
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing

1 file changed

+10
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Testcontainers is especially useful for writing integration tests that talk to a
77

88
In following sections we will describe some of the methods you can use to integrate Testcontainers with your tests.
99

10+
11+
12+
[[testing.testcontainers.via-junit-extension]]
1013
== Using via @Testcontainers JUnit5 extension
1114

1215
The Testcontainers provides JUnit5 extensions, which can be used to manage containers in your tests.
@@ -21,6 +24,8 @@ In most cases, you will need to configure the application to connect to the serv
2124

2225
In this case the lifecycle of the container instance is managed by Testcontainers, as described in official documentation.
2326

27+
28+
[[testing.testcontainers.via-spring-beans]]
2429
== Using via Spring managed beans
2530

2631
The containers provided by Testcontainers can be managed by Spring Boot as beans.
@@ -35,6 +40,7 @@ then we can start the container by importing the configuration class in the test
3540
include-code::beandeclaration/SpringTest[]
3641

3742

43+
[[testing.testcontainers.via-declaration-classes]]
3844
== Using via importing container declaration classes
3945

4046
A common pattern with Testcontainers is to declare the Container instances as static fields in an interface.
@@ -50,6 +56,8 @@ include-code::importcontainers/MyConfiguration[]
5056
TIP: Using interfaces for declaring contains helps with reuse.
5157
When containers are declared in an interface, this can be reused in your javadoc:org.springframework.context.annotation.Configuration[format=annotation] classes and in test classes.
5258

59+
60+
[[test.testcontainers.container-lifecycle]]
5361
== Lifecycle of managed containers
5462

5563
If you have used the annotations and extensions provided by Testcontainers, then the lifecycle of container instances is managed by the Testcontainers.
@@ -80,6 +88,8 @@ This usually happens after all tests using that specific cached application cont
8088

8189
It is important to note that a single test container instance can be, and often is, retained across execution of tests from multiple test classes.
8290

91+
92+
8393
[[testing.testcontainers.service-connections]]
8494
== Service Connections
8595

0 commit comments

Comments
 (0)