Using WireMock to Mock Underlying Services for REST Testing in Spring Boot

WireMock is a simulator for HTTP-based APIs and can be used to mock an API response in case of REST services development and testing. In this article, we will focus on how WireMock can be used to mock an API response while testing REST service that you are developing in SpringBoot. In this way, you can simulate scenarios for which getting test data is time-consuming in the real world. I used it in integration testing Gateway APIs to mock API responses for the underlying services that we were using.

Including WireMock in Project as a Dependency

As mentioned by www.wiremock.org, it is currently recommended that you use the standalone JAR as a dependency with Spring Boot projects. This avoids a conflict over the Jetty version. https://goo.gl/HdZXdb #DataIntegration #ML

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.