Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.85 KB

README.md

File metadata and controls

53 lines (34 loc) · 1.85 KB

PACT Demo

This demo shows, how PACT can be used to assert the contract (REST API) between a client and a service. PACT is client driven, i.e. the client specifies the expected behaviour and generates a according JSON file. This is usually done by writing tests incl. according generation of the file. The corresponding service then can be automatically verified against this pact file. In order to make these pact files accessible they are uploaded to and pulled from a "pact broker".

Instructions

  1. start the broker
  • docker and docker-compose is needed
  • cd pact-broker && sudo docker-compose up
  • web UI under localhost:80
  1. generate pact file via junit test
  • cd consumer && mvn clean install -DskipTests=false
  • this will generate a pact JSON file in consumer/target/pacts
  1. upload generated pact file to broker
  • cd consumer && mvn pact:publish
  1. verify pact against producer
  • cd producer && mvn clean install -DskipTests=false
  1. have a look at http://localhost:80
  • overview of pacts
  • differences between different version of 1 pact
  • overview of relations of services via a graph

Resources