SlideShare a Scribd company logo
1 of 34
Download to read offline
Pain Free Microservices
Integration
Using Contract Tests With Pact
Ama Asare & Danilo Sato
Some context
● Microservices architecture
● Agile environment
● Collaboration between teams
Usual problem
● How to test all components work together?
● How to evolve an API with confidence?
Usual solution
● Fully integrated tests:
៙ Slow
៙ Hard to maintain
៙ Lots of infrastructure
៙ Hard to fix issues (which part failed?)
Unit tests at system boundaries?
● Make assumptions about collaborators
● Test your item of interest with those assumptions
System A
Mock
System B
System A
Actual
System B
A step further
System A
Actual
System B
record
Two steps further
System A
record
assume B
Actual
System Bverify
Mock
System A
Why do you need
Contract Tests?
Why
● Fast Feedback
៙ Detect breaking API changes early
៙ Detect what broke quickly
● Confidence to Deploy
៙ Decouple deployments
Why
● Enables Consumer-Driven Contract Testing
៙ TDD at a higher level!
៙ Can develop consumers before providers
៙ Providers implement only what’s needed
How to implement?
With Pact
JS Consumer - Setup
JS Consumer - Arrange
JS Consumer - Act and Assert
Pact File (JSON)
Consumer assumes...
Java Provider - Verify (Gradle)
How to share contracts?
Using Pact Broker!
Pact Broker
Pact Broker
Java Provider - Verify (Gradle)
How to integrate into
the pipeline?
Consumer Pipeline
Commit PackageTest
Unit Test
Contract
Test
Functional
Test
Tag with
“prod”
Publish
Deploy to
Dev
Deploy to
QA
Deploy to
Prod
Publish
Contract
Tag with
“dev”
Tag with
“qa”
Provider Pipeline
Commit PackageTest
Unit Test
Verify
Contract
Functional
Test
Verify
Contract
Publish
Deploy to
Dev
Deploy to
QA
Deploy to
Prod
Verify
Contract
Verify
Contract
➔ ➔ ➔ ➔LATEST QADEV PROD
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
PROVIDER
CONSUMER A
(age, name)
CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v2 v2v2 v2PROVIDER
v2 v1v2 v1CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v3 v3v3 v2PROVIDER
v2 v1v2 v1CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v3 v2v3 v2PROVIDER
v2 v1v2 v1CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v3 v2v3 v2PROVIDER
v2 v2v2 v1CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v3 v3v3 v3PROVIDER
v2 v2v2 v1CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
{
“age”: 5,
“name”: “John Doe”
}
{
“age”: 5,
“name”: “John Doe”,
“firstName”: “John”,
“lastName”: “Doe”
}
{
“age”: 5,
“firstName”: “John”,
“lastName”: “Doe”
}
PROVIDER v1 v2 v3
LATEST QADEV PRODUCTION
v3 v3v3 v3PROVIDER
v2 v2v2 v2CONSUMER A
(age, name)
v1 v1v1 v1CONSUMER B
(age)
Want to learn more?
Learning Resources
❏ Pact documentation: https://docs.pact.io
❏ Github repos: https://github.com/pact-foundation
❏ Articles:
❏ Consumer-Driven Contracts
❏ De-coupling releases using Pact Broker
❏ Testing Strategies in a Microservices Architecture
THANK YOU
For questions or suggestions:
Ama Asare
Danilo Sato

More Related Content

Similar to LF_APIStrat17_Pain-Free Microservices Integration Using Contract Tests

The case for consumer-driven contracts
The case for consumer-driven contractsThe case for consumer-driven contracts
The case for consumer-driven contractsDiUS
 
Testing with Limited, Vague, and Missing Requirements
Testing with Limited, Vague, and Missing RequirementsTesting with Limited, Vague, and Missing Requirements
Testing with Limited, Vague, and Missing RequirementsTechWell
 
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P KriensOSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriensmfrancis
 
Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...Dawn Wages
 
vodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pactvodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pactvodQA
 
Move fast and consumer driven contract test things
Move fast and consumer driven contract test thingsMove fast and consumer driven contract test things
Move fast and consumer driven contract test thingsAlon Pe'er
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Bram Adams
 
The World's Oldest Django Project
The World's Oldest Django ProjectThe World's Oldest Django Project
The World's Oldest Django Projectubernostrum
 
Fast Delivery DevOps Israel
Fast Delivery DevOps IsraelFast Delivery DevOps Israel
Fast Delivery DevOps IsraelAdrian Cockcroft
 
End-to-End test architectures, a dead End road
End-to-End test architectures, a dead End roadEnd-to-End test architectures, a dead End road
End-to-End test architectures, a dead End roadRoy Braam
 
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li Databricks
 
Real-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCReal-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCAlexandre Gouaillard
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc projectAlexandre Gouaillard
 
Inside the Windows Insider Program
Inside the Windows Insider ProgramInside the Windows Insider Program
Inside the Windows Insider Programwinsider
 
Customer’s Choice @ GDG Android Berlin on January meetup
Customer’s Choice @ GDG Android Berlin on January meetupCustomer’s Choice @ GDG Android Berlin on January meetup
Customer’s Choice @ GDG Android Berlin on January meetupHasan Hosgel
 
What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?Rogue Wave Software
 

Similar to LF_APIStrat17_Pain-Free Microservices Integration Using Contract Tests (20)

The case for consumer-driven contracts
The case for consumer-driven contractsThe case for consumer-driven contracts
The case for consumer-driven contracts
 
Testing with Limited, Vague, and Missing Requirements
Testing with Limited, Vague, and Missing RequirementsTesting with Limited, Vague, and Missing Requirements
Testing with Limited, Vague, and Missing Requirements
 
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P KriensOSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
 
Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...
 
vodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pactvodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pact
 
Hardening
HardeningHardening
Hardening
 
Docker all the way
Docker all the wayDocker all the way
Docker all the way
 
Move fast and consumer driven contract test things
Move fast and consumer driven contract test thingsMove fast and consumer driven contract test things
Move fast and consumer driven contract test things
 
Shipping for mobile at Spotify
Shipping for mobile at SpotifyShipping for mobile at Spotify
Shipping for mobile at Spotify
 
Slimfast
SlimfastSlimfast
Slimfast
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!
 
The World's Oldest Django Project
The World's Oldest Django ProjectThe World's Oldest Django Project
The World's Oldest Django Project
 
Fast Delivery DevOps Israel
Fast Delivery DevOps IsraelFast Delivery DevOps Israel
Fast Delivery DevOps Israel
 
End-to-End test architectures, a dead End road
End-to-End test architectures, a dead End roadEnd-to-End test architectures, a dead End road
End-to-End test architectures, a dead End road
 
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li
From Data to Actions and Insights at Conviva with Rui Zhang and Yan Li
 
Real-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCReal-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTC
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc project
 
Inside the Windows Insider Program
Inside the Windows Insider ProgramInside the Windows Insider Program
Inside the Windows Insider Program
 
Customer’s Choice @ GDG Android Berlin on January meetup
Customer’s Choice @ GDG Android Berlin on January meetupCustomer’s Choice @ GDG Android Berlin on January meetup
Customer’s Choice @ GDG Android Berlin on January meetup
 
What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?
 

More from LF_APIStrat

LF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat
 
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...LF_APIStrat
 
LF_APIStrat17_Super-Powered REST API Testing
LF_APIStrat17_Super-Powered REST API TestingLF_APIStrat17_Super-Powered REST API Testing
LF_APIStrat17_Super-Powered REST API TestingLF_APIStrat
 
LF_APIStrat17_How Mature are You? A Developer Experience Maturity Model
LF_APIStrat17_How Mature are You? A Developer Experience Maturity ModelLF_APIStrat17_How Mature are You? A Developer Experience Maturity Model
LF_APIStrat17_How Mature are You? A Developer Experience Maturity ModelLF_APIStrat
 
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...LF_APIStrat
 
LF_APIStrat17_Things I Wish People Told Me About Writing Docs
LF_APIStrat17_Things I Wish People Told Me About Writing DocsLF_APIStrat17_Things I Wish People Told Me About Writing Docs
LF_APIStrat17_Things I Wish People Told Me About Writing DocsLF_APIStrat
 
LF_APIStrat17_Lifting Legacy to the Cloud on API Boosters
LF_APIStrat17_Lifting Legacy to the Cloud on API BoostersLF_APIStrat17_Lifting Legacy to the Cloud on API Boosters
LF_APIStrat17_Lifting Legacy to the Cloud on API BoostersLF_APIStrat
 
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...LF_APIStrat
 
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat
 
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience Team
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience TeamLF_APIStrat17_How We Doubled the Velocity of Our Developer Experience Team
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience TeamLF_APIStrat
 
LF_APIStrat17_API Marketing: First Comes Usability, then Discoverability
LF_APIStrat17_API Marketing: First Comes Usability, then DiscoverabilityLF_APIStrat17_API Marketing: First Comes Usability, then Discoverability
LF_APIStrat17_API Marketing: First Comes Usability, then DiscoverabilityLF_APIStrat
 
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...LF_APIStrat
 
LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions LF_APIStrat
 
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...LF_APIStrat
 
LF_APIStrat17_Case Study: Cold Decision Trees
LF_APIStrat17_Case Study: Cold Decision TreesLF_APIStrat17_Case Study: Cold Decision Trees
LF_APIStrat17_Case Study: Cold Decision TreesLF_APIStrat
 
LF_APIStrat17_Getting Your API House In Order
LF_APIStrat17_Getting Your API House In OrderLF_APIStrat17_Getting Your API House In Order
LF_APIStrat17_Getting Your API House In OrderLF_APIStrat
 
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...LF_APIStrat
 
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...LF_APIStrat
 
LF_APIStrat17_Open Data vs. the World
LF_APIStrat17_Open Data vs. the World LF_APIStrat17_Open Data vs. the World
LF_APIStrat17_Open Data vs. the World LF_APIStrat
 
LF_APIStrat17_Practical DevSecOps for APIs
LF_APIStrat17_Practical DevSecOps for APIsLF_APIStrat17_Practical DevSecOps for APIs
LF_APIStrat17_Practical DevSecOps for APIsLF_APIStrat
 

More from LF_APIStrat (20)

LF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API UnderprotectionLF_APIStrat17_OWASP’s Latest Category: API Underprotection
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
 
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
 
LF_APIStrat17_Super-Powered REST API Testing
LF_APIStrat17_Super-Powered REST API TestingLF_APIStrat17_Super-Powered REST API Testing
LF_APIStrat17_Super-Powered REST API Testing
 
LF_APIStrat17_How Mature are You? A Developer Experience Maturity Model
LF_APIStrat17_How Mature are You? A Developer Experience Maturity ModelLF_APIStrat17_How Mature are You? A Developer Experience Maturity Model
LF_APIStrat17_How Mature are You? A Developer Experience Maturity Model
 
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...
LF_APIStrat17_Connect Your RESTful API to Hundreds of Others in Minutes (Zapi...
 
LF_APIStrat17_Things I Wish People Told Me About Writing Docs
LF_APIStrat17_Things I Wish People Told Me About Writing DocsLF_APIStrat17_Things I Wish People Told Me About Writing Docs
LF_APIStrat17_Things I Wish People Told Me About Writing Docs
 
LF_APIStrat17_Lifting Legacy to the Cloud on API Boosters
LF_APIStrat17_Lifting Legacy to the Cloud on API BoostersLF_APIStrat17_Lifting Legacy to the Cloud on API Boosters
LF_APIStrat17_Lifting Legacy to the Cloud on API Boosters
 
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...
LF_APIStrat17_Contract-first API Development: A Case Study in Parallel API Pu...
 
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
 
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience Team
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience TeamLF_APIStrat17_How We Doubled the Velocity of Our Developer Experience Team
LF_APIStrat17_How We Doubled the Velocity of Our Developer Experience Team
 
LF_APIStrat17_API Marketing: First Comes Usability, then Discoverability
LF_APIStrat17_API Marketing: First Comes Usability, then DiscoverabilityLF_APIStrat17_API Marketing: First Comes Usability, then Discoverability
LF_APIStrat17_API Marketing: First Comes Usability, then Discoverability
 
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...
LF_APIStrat17_Standing Taller with Technology: APIs, IoT, and the Digital Wor...
 
LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions LF_APIStrat17_REST API Microversions
LF_APIStrat17_REST API Microversions
 
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...
LF_APIStrat17_I Believe You But My Enterprise Don't: Adopting Open Standards ...
 
LF_APIStrat17_Case Study: Cold Decision Trees
LF_APIStrat17_Case Study: Cold Decision TreesLF_APIStrat17_Case Study: Cold Decision Trees
LF_APIStrat17_Case Study: Cold Decision Trees
 
LF_APIStrat17_Getting Your API House In Order
LF_APIStrat17_Getting Your API House In OrderLF_APIStrat17_Getting Your API House In Order
LF_APIStrat17_Getting Your API House In Order
 
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...
LF_APIStrat17_Diving Deep into the API Ocean with Open Source Deep Learning T...
 
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...
LF_APIStrat17_Supporting SDKs in 7 Different Programming Languages While Main...
 
LF_APIStrat17_Open Data vs. the World
LF_APIStrat17_Open Data vs. the World LF_APIStrat17_Open Data vs. the World
LF_APIStrat17_Open Data vs. the World
 
LF_APIStrat17_Practical DevSecOps for APIs
LF_APIStrat17_Practical DevSecOps for APIsLF_APIStrat17_Practical DevSecOps for APIs
LF_APIStrat17_Practical DevSecOps for APIs
 

Recently uploaded

TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

LF_APIStrat17_Pain-Free Microservices Integration Using Contract Tests

  • 1. Pain Free Microservices Integration Using Contract Tests With Pact Ama Asare & Danilo Sato
  • 2. Some context ● Microservices architecture ● Agile environment ● Collaboration between teams
  • 3. Usual problem ● How to test all components work together? ● How to evolve an API with confidence?
  • 4. Usual solution ● Fully integrated tests: ៙ Slow ៙ Hard to maintain ៙ Lots of infrastructure ៙ Hard to fix issues (which part failed?)
  • 5. Unit tests at system boundaries? ● Make assumptions about collaborators ● Test your item of interest with those assumptions System A Mock System B System A Actual System B
  • 6. A step further System A Actual System B record
  • 7. Two steps further System A record assume B Actual System Bverify Mock System A
  • 8. Why do you need Contract Tests?
  • 9. Why ● Fast Feedback ៙ Detect breaking API changes early ៙ Detect what broke quickly ● Confidence to Deploy ៙ Decouple deployments
  • 10. Why ● Enables Consumer-Driven Contract Testing ៙ TDD at a higher level! ៙ Can develop consumers before providers ៙ Providers implement only what’s needed
  • 12. JS Consumer - Setup
  • 13. JS Consumer - Arrange
  • 14. JS Consumer - Act and Assert
  • 16. Java Provider - Verify (Gradle)
  • 17. How to share contracts? Using Pact Broker!
  • 20. Java Provider - Verify (Gradle)
  • 21. How to integrate into the pipeline?
  • 22. Consumer Pipeline Commit PackageTest Unit Test Contract Test Functional Test Tag with “prod” Publish Deploy to Dev Deploy to QA Deploy to Prod Publish Contract Tag with “dev” Tag with “qa”
  • 23. Provider Pipeline Commit PackageTest Unit Test Verify Contract Functional Test Verify Contract Publish Deploy to Dev Deploy to QA Deploy to Prod Verify Contract Verify Contract ➔ ➔ ➔ ➔LATEST QADEV PROD
  • 24. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3
  • 25. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION PROVIDER CONSUMER A (age, name) CONSUMER B (age)
  • 26. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v2 v2v2 v2PROVIDER v2 v1v2 v1CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 27. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v3 v3v3 v2PROVIDER v2 v1v2 v1CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 28. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v3 v2v3 v2PROVIDER v2 v1v2 v1CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 29. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v3 v2v3 v2PROVIDER v2 v2v2 v1CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 30. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v3 v3v3 v3PROVIDER v2 v2v2 v1CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 31. { “age”: 5, “name”: “John Doe” } { “age”: 5, “name”: “John Doe”, “firstName”: “John”, “lastName”: “Doe” } { “age”: 5, “firstName”: “John”, “lastName”: “Doe” } PROVIDER v1 v2 v3 LATEST QADEV PRODUCTION v3 v3v3 v3PROVIDER v2 v2v2 v2CONSUMER A (age, name) v1 v1v1 v1CONSUMER B (age)
  • 32. Want to learn more?
  • 33. Learning Resources ❏ Pact documentation: https://docs.pact.io ❏ Github repos: https://github.com/pact-foundation ❏ Articles: ❏ Consumer-Driven Contracts ❏ De-coupling releases using Pact Broker ❏ Testing Strategies in a Microservices Architecture
  • 34. THANK YOU For questions or suggestions: Ama Asare Danilo Sato