Skip to main content

Pactflow Code Demos


We have created a number of example projects and demo material that you can use as references for your rolling out your contract-testing initiatives.


Here are some useful resources when it comes to engaging your teams to help with Pact or contract-testing related initiatives:

Demo PackA general demo pack for introducing Pact & the concepts of contract testingpdf | pptx


Product Catalog System (HTTP/Messages)#

Our standard example is a product catalog website (see React above) which consumes a basic Products API implementing the following HTTP interface. All demo languages implement this interface so that we can easily mix and match technologies.

EndpointExample Response
GET /products[{"id":"09","type":"CREDIT_CARD","name":"Gem Visa","version":"v1"},{"id":"10","type":"CREDIT_CARD","name":"28 Degrees","version":"v1"},{"id":"11","type":"PERSONAL_LOAN","name":"MyFlexiPay","version":"v2"}]
GET /product/1{"id":"09","type":"CREDIT_CARD","name":"Gem Visa","version":"v1"}

The single get product endpoint is not a spelling mistake, and is used to show evolution to more standard resource based design



LanguageUse CaseFramework/TechDescription
JS/NodeJSWebReactReact JS website relying on a Products API
JS/NodeJSWebCypressExample demonstrating how Cypress could be used to generate consumer pacts
JS/NodeJSAWS/SNS/MessagesSNS LambdaAWS Lambda SNS Consumer
JavaMessagesKafkaJava Kafka consumer
NodeJSMessagesKafkaNodeJS Kafka consumer
JavaSOAPJavaJava SOAP API consumer (note: only compatible with the SOAP provider)
.NETAPI.NET.NET Products API consumer
GolangAPIGolangGo API Client
JSOpenAPIPact / Record Replay with NockReact JS website
JavaOpenAPIWiremockJava API client


LanguageUse CaseFramework/TechDescription
JS/NodeJSAPIExpress JSExpressJS API provider
JS/NodeJSAWS/SNS/MessagesExpressJS / AWS SNSAWS Lambda SNS Provider
JavaAPISpring BootJava Spring Boot API provider
JavaMessagesKafkaJava Kafka message provider
JavaSOAPJavaJava SOAP API provider (note: only compatible with the SOAP consumer)
GolangAPIGolangGin API Provider
JSOpenAPI SpecExpressJS / DreddExpressJS API Provider tested with Dredd+OAS
JSOpenAPI SpecPostman + ExpressJSSpring Boot API Provider tested with Postman+OAS
JavaOpenAPI SpecRestAssured + SpringBootSpringBoot API Provider tested with Dredd+OAS