mmock for mocking microservices

It is a very easy to set up though pretty powerful tool with support for delays and handling query params.
It also has a console for checking all the requests and corresponding responses matched.
Here it is https://github.com/jmartin82/mmock.

Below I describe a way to use it with docker-compose for local development.

./assets/mock_servers/service1/validation.yaml

./docker-compose.yml

Then inside other containers you can request it as
curl -X GET "http://service1:8083/api/v5/groupie/validate_participant/111".
From your host machine you can request it as
curl -X GET "http://localhost:8011/api/v5/groupie/validate_participant/111".
And if you open http://localhost:9011/, you will see this request being matched by the config your provided.

Similar Posts

LEAVE A COMMENT