chicio / Contract-Testing-Asynchronous-Messaging-Pact

A sample project for my blog post "", where I show how to create write contract tests for an asynchronous messaging architecture with πŸ“πŸ€ Pact, Junit 5 and MockK πŸ“πŸ€.

Home Page:https://www.fabrizioduroni.it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contract Testing Asynchronous Messaging with Pact and MockK

GitHub license

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.

Description

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.

How to

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

About

A sample project for my blog post "", where I show how to create write contract tests for an asynchronous messaging architecture with πŸ“πŸ€ Pact, Junit 5 and MockK πŸ“πŸ€.

https://www.fabrizioduroni.it

License:MIT License


Languages

Language:Kotlin 100.0%