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
NoteIf you're new to Testcontainers, visit the Testcontainers overview to learn more about Testcontainers and the benefits of using it.
Modules
- Create the project
Set up a Spring Boot project with an external REST API integration using declarative HTTP clients.
- Write tests
Test external REST API integrations using the Testcontainers MockServer module and REST Assured.
- Run tests
Run your Testcontainers MockServer integration tests and explore next steps.