Skip to content

pchrzasz/contract-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Consumer-Driven Contract Tests

Example of how we can test REST API contract between consumer and provider (popular in microservices architecture where there are no dependencies between apps). First solution is ofc E2E testing, but there is simpler idea - contract testing.

Pact is a contract testing tool. Contract testing is a way to ensure that services (such as an API provider and a client) can communicate with each other. Without contract testing, the only way to know that services can communicate is by using expensive and brittle integration tests.

This example consists of consumer consumer-angular-app (REST API client) and provider provider-springboot-app (REST API provider)

How it works

Consumer is providing input to interface. Then calls provider and the test asserts if the results meet the expectations defined in contract.

Pact Broker - repository for pacts contracts

Pact Broker is a tool that is used as artifact repo with versioned pact contracts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published