liveBook · Manning

Testcontainers

As explained in Developer Experience on Kubernetes

Testcontainers is a library for running application dependencies in disposable containers during development and integration testing.

Testcontainers runs application dependencies such as databases, message brokers, and other services in containers during development and integration testing. It provides a programmatic alternative to manually managing dependency containers. section 2.3.1 section 2.4.3

A typical Testcontainers workflow connects dependency startup with the application or test lifecycle:

Spring Boot appointments service

A Java Appointments service depends on PostgreSQL. Running Gradle's bootRun starts the application and its PostgreSQL container automatically; Spring Boot likewise starts the container when tests run. The tests then exercise persistence without a separately managed database. section 2.3.1 section 2.4.3 section 2.4.4

./gradlew bootRun

Run the Java application with Gradle and trigger the dependency-container startup flow. section 2.3.1

How Developer Experience on Kubernetes covers it

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 it assumes
Assumes an application with an external dependency, while demonstrating the container setup needed for Java development and testing.
What you can do after
Operate/configure application and test dependencies through Spring Boot integration with dynamically allocated ports.
How it connects
Connects application dependencies, PostgreSQL, integration testing, Spring Boot, Compose, and live reload.

Also explained in

Compare how 6 books explain Testcontainers →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Developer Experience on Kubernetes. The section links point to the parts of the book it draws on.