Skip to content

Commit

Permalink
Replace 'Testcontainers framework' with just 'Testcontainers'
Browse files Browse the repository at this point in the history
Signed-off-by: Vanio Begic <[email protected]>
  • Loading branch information
thecooldrop committed Feb 16, 2025
1 parent bd96459 commit cea2cef
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In following sections we will describe some of the methods you can use to integr

== Using via @Testcontainers JUnit5 extension

The Testcontainers framework provides JUnit5 extensions, which can be used to manage containers in your tests.
The Testcontainers provides JUnit5 extensions, which can be used to manage containers in your tests.
The extension is activated by applying the

Testcontainers can be used in a Spring Boot test as follows:
Expand All @@ -19,11 +19,11 @@ include-code::vanilla/MyIntegrationTests[]
This will start up a Docker container running Neo4j (if Docker is running locally) before any of the tests are run.
In most cases, you will need to configure the application to connect to the service running in the container.

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

== Using via Spring managed beans

The containers provided by Testcontainers framework can be managed by Spring Boot as beans.
The containers provided by Testcontainers can be managed by Spring Boot as beans.
This method is often used in combination with javadoc:org.springframework.boot.testcontainers.service.connection.ServiceConnection[format=annotation].

To use Testcontainer contains as Spring beans we need to create a configuration class declaring the container as bean:
Expand All @@ -37,7 +37,7 @@ include-code::beandeclaration/SpringTest[]

== Using via importing container declaration classes

A common pattern with Testcontainers framework is to declare the Container instances as static fields in an interface
A common pattern with Testcontainers is to declare the Container instances as static fields in an interface
For example the following interface `MyInterface` declares two containers, one named `mongo` of type MongoDB and another named `neo` of type Neo4j:

include-code::importcontainers/MyInterface[]
Expand All @@ -49,8 +49,8 @@ include-code::importcontainers/MyConfiguration[]

== Lifecycle of managed containers

If you have used the annotations and extensions provided by Testcontainers framework, then the lifecycle of container instances is managed by the Testcontainers framework.
Please refer to the official documentation for the information about lifecycle of the containers, when managed by the Testcontainers framework.
If you have used the annotations and extensions provided by Testcontainers, then the lifecycle of container instances is managed by the Testcontainers.
Please refer to the official documentation for the information about lifecycle of the containers, when managed by the Testcontainers.

When the containers are managed by Spring as beans, then the lifecycle is clearly defined by Spring.
The container beans are created and started before the beans of other types are created.
Expand Down

0 comments on commit cea2cef

Please sign in to comment.