Easy integration testing for Spring WebFlux using Testcontainers
6 min readMar 18, 2024
In this story, we’ll cover Integrations testing for the Spring WebFlux application using Testcontainers.
|· Prerequisites
· Overview
∘ What is Testcontainers?
∘ Why use Testcontainers?
· Let’s code
∘ Create a Spring reactive application
∘ Add Testcontainer to project
· Testing
· Conclusion
· References
Prerequisites
This is the list of all the prerequisites:
- Spring Boot 3+
- Maven 3.6.+
- Java 17 or later
- MongoDB instance installed
- Your favorite IDE (IntelliJ IDEA, Eclipse, NetBeans, VS Code)
- A Docker environment supported by Testcontainers
Overview
What is Testcontainers?
Testcontainers is an open-source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.