TestContainers: Integration Testing Without the Hassle
summary
Project shows using TestContainers (via docker-java) to run real Docker images inside unit tests, spawning ephemeral containers with random host ports so parallel runs don’t clash. Examples include a Redis container and a custom image that receives an instrumenting Java agent; containers auto-download, initialize, inject files, run tests and clean up. Claim: integration tests become repeatable and isolated — previously a suite took ~2.5 months to run sequentially — and the setup demonstrably works with Docker Compose and network linking.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:15Why integration testing
- 3:03Integration test problems
- 5:14Test environment needs
- 7:42Docker for testing
- 8:49TestContainers solutions
- 13:06What is TestContainers
- 16:02Redis example
- 23:54Microservice testing
- 28:58Mock servers in TestContainers
- 33:19Isolation in tests
- 34:43Java agents testing
- 41:32Groovy advanced example
- 45:38Adopting TestContainers
- 46:20Q&A
related talks
15mTestcontainers: Simplify Your Integration Tests and Development
47mIntegration Tests: testcontainers to the Rescue
48mTestContainers: The Revolution for Your Unit Tests
35mReal Integration Tests with TestContainers
48mContainers for Real Integration Tests
26mRemoving Complexity from Integration Tests Using Testcontainers
27mIntegration testing for Microservices with Docker and TestContainers
46mTestcontainers - The past, the present and the future
