Testing REST API integrations using WireMock
Table of contents
Learn how to create a Spring Boot application that integrates with
external REST APIs, then test those integrations using Testcontainers
and WireMock.
Time to complete
20 minutes
In this guide, you'll learn how to:
- Create a Spring Boot application that talks to external REST APIs
- Test external API integrations using WireMock with both the JUnit 5 extension and the Testcontainers WireMock 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 WireMock and Testcontainers.
- Write tests
Test external REST API integrations using WireMock with both the JUnit 5 extension and the Testcontainers WireMock module.
- Run tests
Run your Testcontainers WireMock integration tests and explore next steps.