|
|
@ -2951,11 +2951,11 @@ The following example shows how to do so in Gradle:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[howto-testcontainers]]
|
|
|
|
[[howto-testcontainers]]
|
|
|
|
=== Use TestContainers for integration testing
|
|
|
|
=== Use Testcontainers for integration testing
|
|
|
|
The https://www.testcontainers.org/[TestContainers] library provides a way to manage services running inside Docker containers.
|
|
|
|
The https://www.testcontainers.org/[Testcontainers] library provides a way to manage services running inside Docker containers.
|
|
|
|
It integrates with JUnit, allowing you to write a test class that can start up a container before any of the tests run.
|
|
|
|
It integrates with JUnit, allowing you to write a test class that can start up a container before any of the tests run.
|
|
|
|
TestContainers is especially useful for writing integration tests that talk to a real backend service such as MySQL, MongoDB, Cassandra etc.
|
|
|
|
Testcontainers is especially useful for writing integration tests that talk to a real backend service such as MySQL, MongoDB, Cassandra etc.
|
|
|
|
TestContainers can be used in a Spring Boot test as follows:
|
|
|
|
Testcontainers can be used in a Spring Boot test as follows:
|
|
|
|
|
|
|
|
|
|
|
|
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
|
|
|
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
|
|
|
----
|
|
|
|
----
|
|
|
|