Getting Started Guides

The following guides provide practical projects to learn Testcontainers by getting your hands dirty. Whether you’re looking to ramp up from zero to proficient, or are already an expert, there should be a guide for you.

Testing REST API integrations using MockServer

This guide will explain how to test REST API integrations in a Spring Boot application using Testcontainers Mockserver module.
  • Java
  • Spring Boot
  • REST API
  • MockServer

Testing Spring Boot Kafka Listener using Testcontainers

This guide will explain how to test Spring Boot Kafka Listeners using Testcontainers.
  • Java
  • Spring Boot
  • MySQL
  • Kafka

Testing an ASP.NET Core web app

This guide is built on top of Microsoft's guide Integration tests in ASP.NET Core and how to leverage Testcontainers into it.
  • C#
  • ASP.NET
  • Microsoft SQL Server
  • Entity Framework

The simplest way to replace H2 with a real database for testing

This guide will explain how to replace H2 in-memory database with a real database for testing using Testcontainers in the simplest way.
  • Java
  • Spring Boot
  • PostgreSQL
  • H2

Configuration of services running in a container

This guide will explain how to configure the services running in containers for your tests using Testcontainers.
  • Java
  • PostgreSQL
  • LocalStack

Testcontainers container lifecycle management using JUnit 5

This guide will explain how to manage container lifecycle with Testcontainers using JUnit 5 lifecycle callbacks and JUnit 5 Extension annotations. We will also look into how to use Singleton Containers pattern to use same containers for multiple tests.
  • Java
  • PostgreSQL
  • JUnit
  • Spring Boot

Getting started with Testcontainers in a Java Spring Boot Project

This guide will explain how to test Spring Boot and Spring Data JPA based REST APIs using Testcontainers.
  • Java
  • Spring Boot
  • PostgreSQL
  • REST Assured

Getting started with Testcontainers for Java

This guide will help you to get started with Testcontainers for Java by demonstrating how you can use PostgreSQL for testing.
  • Java
  • PostgreSQL

What is Testcontainers, and why should you use it?

This guide will introduce you to Testcontainers and explains what kind of problems Testcontainers solves.
  • Getting Started
No search results