SlideShare a Scribd company logo
1 of 13
Download to read offline
MICROSERVICES
ERFOLGREICH TESTEN
Consumer	Driven	Contract	Testing	mit Spring	Cloud	Contract
Frank	Scheffler
Senior	Solution	Architect
@maverick_1601
Florian	Pfleiderer
Senior	Solution	Consultant
@fpfleiderer
Integrated	Test	Scope
Integration	Testing:	then and now ...
Consumer	Driven	Contract	Testing S.2
Module	A
Module	B
Module	C
In-Process
Communication
• Inter-Process Communication	
(REST/Messaging)
• Multiple	Transactions
• Polyglot Persistence
• Independent	Teams	&	
Deployments
Integrated	Test	Scope
Testing in	a	Microservice Environment
Consumer	Driven	Contract	Testing S.3
Service
A
Service
C
Service
B
Integrated	Testing doesn‘t scale!
Consumer	Driven	Contract	Testing S.4
#	of involved services
fully integrated
testing
isolated integration
testing based on	contracts
It‘s all	about the Contract
Consumer	Driven	Contract	Testing S.5
Consumer
Consumer
Provider
ContractBlack	Box	View(s) White	Box	View
Aligned &	tested?
Spring	Cloud	Contract @	REST
Consumer	Driven	Contract	Testing S.6
Groovy
Contracts
Maven/Gradle
WireMock
Stub Server
Quelle:	https://cloud.spring.io/spring-cloud-contract/
Interface
Schema
Contract-based Testing Approach
Consumer	Driven	Contract	Testing S.7
Consumer ProviderContract
Stub(s) Test(s)
Contract Aspects
Consumer	Driven	Contract	Testing S.8
Contract
Interface
Schema
Protocol
Business	Logic
Security
Documentation
Performance
Spring	Cloud	
Contract
Based on	„example“	
requests/messages
Isolated Testing Example
Consumer	Driven	Contract	Testing S.9
Service	A Service	B
Business	Logic
Integration	
Service
(e.g.	Feign)
REST	Controller Business	Logic
Integration	Service
(e.g.	RestTemplate)
Consumer	Test
<<generated>>
WireMock Stubs
<<generated>>
Contract Test
Mockito Mocks
Unit	Test
Mockito Mocks
Unit	Test
Mockito Mocks
Consumer	Test
API	
Performance	
Test
Demo
Consumer	Driven	Contract	Testing S.10
Production
Consumer-Driven Contract Development
Consumer	Driven	Contract	Testing S.11
C
Create/Change
Contract
Consolidate
Contract
C P
Generate
Stubs
Implement
using Stubs
C
CI
Implement API	
using Contract Test
Implement
business logic
P P
CI/CD
CI/CD
Summary
Consumer-Driven Contract Testing
• Scalable testing for distributed
systems
• Focus	on	consumer expectations
drives API	design
• Loose	coupling in	the
development process
• Automated compatibility
verification of interfaces
Consumer	Driven	Contract	Testing S.13
Spring	Cloud	Contract
• Contracts as 1st-class	citizens
• Groovy	DSL
• Stub generation
• StubRunner Spring/Standalone
• Spring	MockMvc/JAX-RS
• JSON,	REST	&	Messaging
• Backward compatibility testing
WAS	SIND	IHRE	ERFAHRUNGEN	
MIT	TESTS	IN	VERTEILTEN	
SYSTEMEN?
Frank	Scheffler
Senior	Solution	Architect
@maverick_1601
Florian	Pfleiderer
Senior	Solution	Consultant
@fpfleiderer

More Related Content

Similar to Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spring Cloud Contract (OOP 2018)

Achieving Interoperability Through Web Services
Achieving Interoperability Through Web ServicesAchieving Interoperability Through Web Services
Achieving Interoperability Through Web Services
Jorgen Thelin
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
Daniel Berg
 
Raju ponnam CV
Raju ponnam CVRaju ponnam CV
Raju ponnam CV
raju p
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
Jorgen Thelin
 

Similar to Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spring Cloud Contract (OOP 2018) (20)

Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
 
Consumer driven contracts in java world
Consumer driven contracts in java worldConsumer driven contracts in java world
Consumer driven contracts in java world
 
Migrate existing web services and build native microservices in bluemix
Migrate existing web services and build native microservices in bluemixMigrate existing web services and build native microservices in bluemix
Migrate existing web services and build native microservices in bluemix
 
Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud
 
Wcf best practice
Wcf best practiceWcf best practice
Wcf best practice
 
Achieving Interoperability Through Web Services
Achieving Interoperability Through Web ServicesAchieving Interoperability Through Web Services
Achieving Interoperability Through Web Services
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
 
Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
 
Evolution from LwCCM to UCM
Evolution from LwCCM to UCMEvolution from LwCCM to UCM
Evolution from LwCCM to UCM
 
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
 
Cloud-Native Applications with Microservices and Containers
Cloud-Native Applications with Microservices and ContainersCloud-Native Applications with Microservices and Containers
Cloud-Native Applications with Microservices and Containers
 
e-SUAP - Pubblicazione scientifica per evento Inista 2014 (International Symp...
e-SUAP - Pubblicazione scientifica per evento Inista 2014 (International Symp...e-SUAP - Pubblicazione scientifica per evento Inista 2014 (International Symp...
e-SUAP - Pubblicazione scientifica per evento Inista 2014 (International Symp...
 
Microservices.pdf
Microservices.pdfMicroservices.pdf
Microservices.pdf
 
Dependency Injection in .NET
Dependency Injection in .NETDependency Injection in .NET
Dependency Injection in .NET
 
Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)
 
Raju ponnam CV
Raju ponnam CVRaju ponnam CV
Raju ponnam CV
 
Solution guide -load balancing with the brocade server iron platform --micros...
Solution guide -load balancing with the brocade server iron platform --micros...Solution guide -load balancing with the brocade server iron platform --micros...
Solution guide -load balancing with the brocade server iron platform --micros...
 
Project findings paper TMForum catalyst 2014 B2B service bundling 1.0
Project findings paper TMForum catalyst 2014 B2B service bundling 1.0Project findings paper TMForum catalyst 2014 B2B service bundling 1.0
Project findings paper TMForum catalyst 2014 B2B service bundling 1.0
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spring Cloud Contract (OOP 2018)