Skip to content

a very simple setup for generating a pact file by a client, uploading it to the pact broker and pulling it again for verifying a service

Notifications You must be signed in to change notification settings

sikron/pact-example-with-broker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a very simple setup for generating a pact file by a client, uploading it to the pact broker and pulling it again for verifying a service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages