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
- Uses disposable database containers to make automated tests isolated and portable across developer environments and CI/CD pipelines.
- How deep it goes
- Shows a pytest fixture that starts and stops Docker Compose services, but does not explain Testcontainers internals.
- Examples
- Tests a company API endpoint against a database container initialized with default companies and checks for HTTP 200.
- What you can do after
- Apply it via Testcontainers’ DockerCompose integration to manage database services for a pytest endpoint test.
Read how Build Financial Software with Generative AI (From Scratch) explains Testcontainers →
Developer Experience on Kubernetes
Testcontainers is a library for running application dependencies in disposable containers during development and integration testing.
- How it is used
- Runs application dependencies in containers during local development and integration testing.
- How deep it goes
- Explains startup and test integration, dynamic ports, and Compose trade-offs, but not library configuration or container internals.
- Examples
- Uses an Appointments service with PostgreSQL, Gradle bootRun, and Spring Boot tests as concrete workflows.
- What you can do after
- Operate/configure application and test dependencies through Spring Boot integration with dynamically allocated ports.
Read how Developer Experience on Kubernetes 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.
Also covered in
- Testing Spring Boot ApplicationsIn early access (MEAP)
- Vibe EngineeringIn early access (MEAP)
What to know first
- containerA software container is an isolated execution environment that packages an application and its dependencies, typically sharing the host operating-system kernel.
- clientA client is a person, organization, or software component that requests, receives, or uses a product, service, or capability provided by another party or system.
- GoGo is a statically typed, compiled, general-purpose programming language with garbage collection and built-in support for concurrency.
- software testingSoftware testing is the systematic evaluation of software under specified inputs or conditions against expected behavior or requirements to assess correctness and detect defects.
Related concepts
- Dockeruses · Docker is a platform and toolset 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 using declarative configuration.
- dev serviceused by · Dev Services is a Quarkus feature that automatically starts and manages disposable supporting service instances during development and testing.
- end-to-end testingused by · End-to-end testing evaluates a complete system workflow across integrated components, from an external entry point to its observable outcome.
Questions about Testcontainers
What is Testcontainers?
Testcontainers is a library for programmatically running and managing disposable containerized dependencies and environments during automated tests and development.
Which Manning books explain Testcontainers?
Build Financial Software with Generative AI (From Scratch), Developer Experience on Kubernetes, Kafka Streams in Action, Second Edition, gRPC Microservices in Go, BDD in Action, Second Edition and Kafka for Architects.
What should I know before learning Testcontainers?
Manning books that teach Testcontainers usually introduce container, client, Go and software testing first.
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.





