Skip to content

reAlHe/pact-spring-kotlin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pact-JVM-Spring-Example

An example repository consisting of 2 Microservices whose interfaces are tested with the PACT framework.

Architecture

There are 2 microservices interacting with each other. The pact-consumer-demo service offers following REST endpoints:

  • /products/{id} : retrieves information about a product, identified by its id.

The pact-provider-demo offers the following REST-endpoint:

  • /productDetails/{id} : delivers the product details for the product identified by its id

When the /products/{id} endpoint is called pact-consumer-demo fetches the product details from the pact-provider-demo by calling the /productDetails/{id} endpoint.

infrastructure

A docker-compose.yml is provided containing the required infrastructure services, i.e. a pact-broker, that manages the contracts and a mongo db acting as storage for the 2 microservices.

pacts

After running teh consumer tests, a pact is generated, located under root with path /target/pacts. This pact can be posted at the pact broker:

POST http://{pact broker host}/pacts/provider/{provider name}/consumer/{consumer name}/version/{version}

Please note that the consumer and provider names, provided in the path must match exactly the names within the posted pact json.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages