Delightful integration tests with testcontainers
summary
Library-level tooling for running Docker dependencies from tests, claiming reliable integration tests by programmatically controlling container lifecycle and configuration. Uses Testcontainers Java (and community ports for Go, .NET, Node), integrates with JUnit and Spring, and runs Kafka, Postgres and Redis inside tests. Demo spins up Kafka/Postgres/Redis, injects dynamic properties, randomizes ports and cleans up containers so tests pass quickly and repeatedly; supports parallel runs, custom wait strategies and parameterized runs across multiple image versions.
AI-written summary · about
chapters (28)
- 0:00Introduction
- 1:50Testing pyramid
- 7:25integration tests
- 9:55docker
- 11:15test containers
- 12:40extensive cleanup
- 13:45efficient integration tests
- 15:35other languages
- 17:10demo
- 18:30tests
- 20:27boilerplate
- 21:20test containers dependencies
- 21:52generic container
- 22:38exposed port
- 23:14Dynamic property source
- 24:55Starting Kafka container
- 26:40Running the test
- 29:35Database setup
- 30:09Data initialization
- 30:36docker image entry point
- 32:27docker id
- 32:43docker commands
- 32:57task containers
- 33:24look and feel
- 33:38life cycle
- 34:28local development
- 36:00complex solutions
- 37:03Compatible environments
