Testcontainers
Testcontainers is a library for programmatically running and managing disposable containerized dependencies and environments during automated tests and development.
Build Financial Software with Generative AI (From Scratch)
Testcontainers is a library for creating and managing disposable containerized dependencies for automated tests.
- How it is used
- Isolates database-backed tests so API and persistence checks can run reliably in CI/CD.
- How deep it goes
- Demonstrates a pytest DockerCompose fixture that starts and stops a fresh database for an API status test.
- Examples
- Uses a DockerCompose pytest fixture to test GET /api/v1/companies against a fresh database.
- What you can do after
- Operate/configure it to run self-contained database-backed tests without a developer-specific running container.
Read how Build Financial Software with Generative AI (From Scratch) explains Testcontainers →
Kafka Streams in Action, Second Edition
Testcontainers is a library for running disposable containerized dependencies during automated tests and managing their lifecycle.
- How it is used
- Runs a disposable Kafka broker for JUnit integration tests that exercise Kafka Streams against live infrastructure.
- How deep it goes
- Explains annotations, container scope, broker configuration, startup waiting, production, consumption, assertions, and teardown.
- Examples
- Uses a KafkaContainer, timestamped records, hopping-window counts, output-topic consumption, and expected-record assertions.
- What you can do after
- Operate/configure Kafka integration tests with managed containers, broker endpoints, lifecycle control, test data, and cleanup.
Read how Kafka Streams in Action, Second Edition explains Testcontainers →
gRPC Microservices in Go
Testcontainers is a library ecosystem for programmatically creating and managing disposable containerized dependencies during tests.
- How it is used
- Provisions running dependencies for database-adapter integration tests and an application stack for end-to-end tests.
- How deep it goes
- Works through suite setup, container readiness, endpoint use, assertions, and stack teardown without examining Testcontainers internals.
- Examples
- Uses Order service Save and Get assertions against MySQL and a gRPC Create and Get flow against a Compose stack.
- What you can do after
- Apply it via testcontainers-go to test an adapter against MySQL and use LocalDockerCompose to start and stop a gRPC test stack.
BDD in Action, Second Edition
Testcontainers is an open-source library that provides lightweight, disposable containerized dependencies for automated tests.
- How it is used
- Supplies Docker-managed databases and services for automated integration and acceptance tests.
- How deep it goes
- Explains dependency setup, container startup, reuse, thread safety, and framework integration, but does not detail Docker internals.
- Examples
- Uses PostgreSQL startup, shared and thread-local containers, and Spring Boot properties wired into Cucumber step definitions.
- What you can do after
- Operate/configure containerized test dependencies and connect their runtime properties to automated tests.
Read how BDD in Action, Second Edition explains Testcontainers →
Kafka for Architects
Testcontainers is a library for running disposable containerized dependencies during automated tests.
- How it is used
- Runs disposable Dockerized Kafka clusters during automated integration tests.
- How deep it goes
- Explains runtime startup, producer and consumer validation, and infrastructure trade-offs without detailing implementation code.
- Examples
- Uses ProfileService producer and Customer360Service consumer tests against a Dockerized Kafka cluster.
- What you can do after
- Apply it via Testcontainers and Docker to validate Kafka behavior through real network, protocol, and persistence paths.
Related concepts
- Dockeruses · Docker is a platform and ecosystem for building, distributing, and running applications in containers.
- integration testused by · An integration test evaluates whether multiple software components, or a component and an external dependency, interact and behave correctly together.
- Docker Composeuses · Docker Compose is a tool for defining and running applications composed of multiple containers through declarative configuration.
- dev serviceused by · Dev Services is a Quarkus feature that automatically starts and manages disposable supporting service instances during development and testing.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




