Share feedback
Answers are generated based on the documentation.

Testing REST API integrations using MockServer

Table of contents

Learn how to create a Spring Boot application that integrates with external REST APIs, then test those integrations using Testcontainers and MockServer.
Time to complete 20 minutes

In this guide, you will learn how to:

  • Create a Spring Boot application that talks to external REST APIs
  • Test external API integrations using the Testcontainers MockServer module

Prerequisites

  • Java 17+
  • Maven or Gradle
  • A Docker environment supported by Testcontainers
Note

If you're new to Testcontainers, visit the Testcontainers overview to learn more about Testcontainers and the benefits of using it.

Modules

  1. Create the project

    Set up a Spring Boot project with an external REST API integration using declarative HTTP clients.

  2. Write tests

    Test external REST API integrations using the Testcontainers MockServer module and REST Assured.

  3. Run tests

    Run your Testcontainers MockServer integration tests and explore next steps.