SlideShare a Scribd company logo
Stick to the rules!
Consumer Driven Contracts
Marcin Grzejszczak @mgrzejszczak
Jakub Kubrynski @jkubrynski
Jakub
Kubryński
@jkubrynski
www.kubrynski.com
Marcin
Grzejszczak
@mgrzejszczak
toomuchcoding.blogspot.com
TDD on architectural level
@mgrzejszczak @jkubrynski
What is
Consumer Driven Contract
@mgrzejszczak @jkubrynski
● Server
● Consumer
● Contract
Consumer Driven Contract
benefits
@mgrzejszczak @jkubrynski
Example
@mgrzejszczak @jkubrynski
Example
@mgrzejszczak @jkubrynski
How to solve it
@mgrzejszczak @jkubrynski
● Consumer’s tests
● Server tests
Contract definition
@mgrzejszczak @jkubrynski
● Contract defines communication
● Your stub is your contract - verify it!
● Expose your stub to your consumers
Consumer Technology
@mgrzejszczak @jkubrynski
Wiremock
http://wiremock.org
testCompile 'com.github.tomakehurst:wiremock:1.53'
{
"request": {
"method": "GET",
"url": "/hello"
},
"response": {
"status": 200,
"body": "Hello world!",
"headers": { "Content-Type": "text/plain" }
}
}
Server Technology
@mgrzejszczak @jkubrynski
Accurate REST
https://github.com/Codearte/accurest
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.codearte.accurest:accurest-gradle-plugin:0.5.0'
}
}
apply plugin: 'accurest'
Server Technology
@mgrzejszczak @jkubrynski
Accurate REST
def shouldMarkClientAsNotFraud() {
given:
def request = given()
.header('Content-Type', 'application/frud+json')
.body('{"clientPesel":"12345678901",
"loanAmount":123.123}')
when:
def response = given().spec(request)
.put("/fraudcheck")
then:
response.statusCode == 200
response.header('Content-Type') == 'application/fraud+json'
and:
def responseBody = parseText(response.body.asString())
responseBody.fraudCheckStatus == "OK"
}
Example
@mgrzejszczak @jkubrynski
Live coding
@mgrzejszczak @jkubrynski
Q&A
@mgrzejszczak @jkubrynski
github.com/marcingrzejszczak/4developers_cdc_examples

More Related Content

PPT
(WS11) Saša Matijašić (LogIT internet usluge): Quo Vadis, Browser?*
PDF
Microservices: test smarter not harder (LAST Conference 2018)
DOC
Journal format
PPTX
Photo Portfolio
PDF
Abdullah bin saba tokoh fiktif
PPTX
Intro to Pylons / Pyramid
PDF
Trends in the conclusion of tax treaties by developing countries
PPT
Penilaian kinerja
(WS11) Saša Matijašić (LogIT internet usluge): Quo Vadis, Browser?*
Microservices: test smarter not harder (LAST Conference 2018)
Journal format
Photo Portfolio
Abdullah bin saba tokoh fiktif
Intro to Pylons / Pyramid
Trends in the conclusion of tax treaties by developing countries
Penilaian kinerja

Similar to 4Developers 2015: Stick to the rules - Consumer Driven Contracts - Marcin Grzejszczak, Jakub Kubryński (20)

PDF
Consumer Driven Contracts and Your Microservice Architecture
PDF
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
PPTX
Consumer Driven Contracts for microservices
PPTX
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
PDF
Spring Cloud Contract And Your Microservice Architecture
PDF
Consumer Driven Contracts and Your Microservice Architecture
PPTX
Consumer Driven Contracts and Your Microservice Architecture
PDF
Consumer Driven Contracts To Enable API Evolution @Geecon
PDF
Microservices: Consumer Driven Contracts in Practice
PDF
Creating and testing REST contracts with Accurest Gradle
PDF
TDD for Microservices
PPTX
Consumer Driven Contracts
PDF
Consumer-Driven Contracts to enable API evolution
PPTX
Consumer driven contracts in java world
PDF
Consumer driven contract testing
PDF
Consumer Driven Contracts and Your Microservice Architecture
PDF
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
PDF
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
PDF
Consumer-Driven Contract Testing
PDF
Max Yekaterynenko - Magento Architecture, Next Steps
Consumer Driven Contracts and Your Microservice Architecture
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Consumer Driven Contracts for microservices
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
Spring Cloud Contract And Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts To Enable API Evolution @Geecon
Microservices: Consumer Driven Contracts in Practice
Creating and testing REST contracts with Accurest Gradle
TDD for Microservices
Consumer Driven Contracts
Consumer-Driven Contracts to enable API evolution
Consumer driven contracts in java world
Consumer driven contract testing
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
Consumer-Driven Contract Testing
Max Yekaterynenko - Magento Architecture, Next Steps
Ad

Recently uploaded (20)

PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Transform Your Business with a Software ERP System
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
System and Network Administration Chapter 2
PDF
top salesforce developer skills in 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
System and Network Administraation Chapter 3
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms I-SECS-1021-03
Transform Your Business with a Software ERP System
PTS Company Brochure 2025 (1).pdf.......
System and Network Administration Chapter 2
top salesforce developer skills in 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Wondershare Filmora 15 Crack With Activation Key [2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How to Migrate SBCGlobal Email to Yahoo Easily
System and Network Administraation Chapter 3
Internet Downloader Manager (IDM) Crack 6.42 Build 41
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Ad

4Developers 2015: Stick to the rules - Consumer Driven Contracts - Marcin Grzejszczak, Jakub Kubryński