devbhuwan / consumer-driven-contracts-testing-using-pact

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consumer Driven Contract Testing using Pact

An example scenario

Here we have an example describing Pact tests between a consumer (the Billing Service and the User Frontend) and its provider (the User Service).

Billing System

How to run example

  • First of all, you need to start Pact Broker

cd devops && docker-compose up
  • Secondly, generate and publish the Billing Service pact consumer contracts to the pact broker

mvn clean verify -f billing-service
  • Then, generate and publish the User Frontend pact consumer contracts to the pact broker

cd user-frontend
npm run pact:test &&  npm run pact:publish
  • Finally, we need to verify those contracts generated by consumer with provider i.e. User Service

mvn clean verify -f user-service

To to see pact contracts live documentation: http://localhost:7080/

About

License:MIT License


Languages

Language:TypeScript 48.5%Language:Java 34.2%Language:JavaScript 9.7%Language:HTML 7.2%Language:CSS 0.4%