A sample project for my blog post Contract testing asynchronous messaging with Pact and MockK, where I show how to create write contract tests for an asynchronous messaging architecture with Pact and MockK.
This is a quote from the post:
...In the last weeks I worked with my colleague Felice Giovinazzo on a new feature for the refund process (as may already know from some of my previous posts in the last 2 years I worked mainly on backend applications). In this new feature we have a messaging-based communication between microservices. The messaging system used is RabbitMQ. In lastminute.com group we are already using Pact to implement contract testing for the classic RESTful interaction between microservices...
Click on the link above to read the posts.
If you wanna try the example in this repository you just have to:
- start the pact broker by launching the following commands:
cd pact-broker
docker-compose up
- execute the test of the
AccountService
consumer and publish the contract with the following maven command:
mvn pact:publish
- execute the test of the
RefundService
producer to verify the pact published