This document introduces TestContainers, an open source Java library that supports integration testing for applications that depend on external resources like databases. It allows tests to use real Docker containers to manage these dependent services. Tests run quickly and are portable across environments because the containers are started and stopped for each test. The document provides examples of using TestContainers with Spring Boot tests to launch containers for PostgreSQL and Redis, and to configure a MockServer container to handle external API dependencies. It suggests TestContainers is useful for testing microservices and Java agents that depend on external services or APIs.
Related topics: