Why you should use Wiremock for API development and testing

Introduction

Have you ever packed Christmas gifts for your kids and pretended it came from Santa? Well, the kids would certainly be ecstatic and thats the whole purpose of gifts right? Seeing your kids happy?

What is Wiremock?

Wiremock Illustration

Working with wiremock

java -jar wiremock-standalone-2.27.2.jar
wiremock — how it looks like when it starts
{    "request": {        "method": "GET",        "url": "/payment-gateway/process-payment"    },    "response": {        "status": 200,        "headers":{            "content-type": "application/json"        },        "jsonBody": {            "payment": "approved"        }    }}

when a request is made to https://<your-domain>/payment-gateway/process-payment”, it will respond with the response specified above

Wiremock Directory
calling mocked endpoint from postman

Logging and Debugging

Conclusion

Senior Software Engineer in Test

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store