Integration testing for Microservices with Docker and TestContainers
summary
Node.js user service uses MongoDB and Redis and the test suite boots real Docker images so one test command both starts containers and runs JUnit-style integration tests. TestContainers uses a generic container API to pull images and inject connection strings, the demo runs self-contained MongoDB and Redis and four integration tests pass even after the cloud DB is disconnected. Downsides are longer run time and reliance on Docker Hub availability, but the setup removes flaky CI and local dependency issues.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 3:25Testing pyramid evolution
- 7:47TestContainers concept
- 14:33Live demo setup
- 21:11Test results and benefits
- 22:34TestContainers modules
- 24:42Pros and cons
- 26:05Closing and contact
related talks
47mIntegration Tests: testcontainers to the Rescue
15mTestcontainers: Simplify Your Integration Tests and Development
48mContainers for Real Integration Tests
30mUsing Docker & Compose to Simplify Integration Testing
24mIntegration Testing Made Easy: Leveraging Testcontainers and
51mTestContainers: Integration Testing Without the Hassle
59mIntegration and end-to-end testing with TestContainers and JUnit 5
26mRemoving Complexity from Integration Tests Using Testcontainers
