Share feedback
Answers are generated based on the documentation.

Testing REST API integrations in Micronaut apps using WireMock

Table of contents

Learn how to create a Micronaut application that integrates with external REST APIs, then test those integrations using WireMock and the Testcontainers WireMock module.
Time to complete 20 minutes

In this guide, you'll learn how to:

  • Create a Micronaut application that talks to external REST APIs
  • Test external API integrations using WireMock
  • Use the Testcontainers WireMock module to run WireMock as a Docker container

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 Micronaut project with an external REST API integration using declarative HTTP clients.

  2. Write tests

    Test external REST API integrations using WireMock and the Testcontainers WireMock module.

  3. Run tests

    Run your Testcontainers WireMock integration tests and explore next steps.