Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Consumer Driven Contract Testing con Spring Cl...
Search
Eddú Meléndez Gonzales
July 06, 2019
Programming
110
0
Share
Consumer Driven Contract Testing con Spring Cloud Contract
Eddú Meléndez Gonzales
July 06, 2019
More Decks by Eddú Meléndez Gonzales
See All by Eddú Meléndez Gonzales
Desarrollo de Software en la Era de la Transformación Digital
eddumelendez
1
340
Consumer Driven Contract Testing with Spring Cloud Contract
eddumelendez
0
140
Construyendo contenedores para aplicaciones Java con JIB
eddumelendez
0
210
CI CD de aplicaciones Spring Boot con Jenkins X
eddumelendez
0
1.4k
Testeando Aplicaciones con Docker y Arquillian Cube
eddumelendez
0
240
SpringOne Recap
eddumelendez
0
64
Intro to Spring Boot
eddumelendez
0
97
Other Decks in Programming
See All in Programming
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
290
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
11
4.7k
誰も頼んでない機能を出荷した話
zekutax
0
140
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
200
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
200
Moments When Things Go Wrong
aurimas
3
120
Swiftのレキシカルスコープ管理
kntkymt
0
200
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
250
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
220
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
The Invisible Side of Design
smashingmag
302
52k
Bash Introduction
62gerente
615
210k
The Language of Interfaces
destraynor
162
26k
How STYLIGHT went responsive
nonsquared
100
6.1k
How to build a perfect <img>
jonoalderson
1
5.5k
WCS-LA-2024
lcolladotor
0
600
First, design no harm
axbom
PRO
2
1.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
So, you think you're a good person
axbom
PRO
2
2k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
Transcript
Consumer Driven Contract Testing con Spring Cloud Contract Eddú Meléndez
Gonzales
Sobre mí • • Desarrollador Java • Ingeniero de Software
• Arquitecto por Accidente • Contribuidor Open Source (spring-*, spring-cloud-contract, mybatis, arquillian) • Twitter: @eddumelendez • Blogger: https://blog.eddumelendez.me
La evolución de la Arquitectura de Software
Tendencias de Arquitectura
Qué necesitamos resolver? • Deployment • APIs • Contracts •
Testing • Service Discovery • Health Checking • Configuration • Circuit Breaking • Tracing • Logging • Monitoring • ...
Qué necesitamos resolver? • Deployment • APIs • Contracts •
Testing • Service Discovery • Health Checking • Configuration • Circuit Breaking • Tracing • Logging • Monitoring • ...
Test usando MockRestServiceServer @RestClientTest public class MockServerTest { @Autowired private
MockRestServiceServer server; @Test public void shouldReturnAllItems() { this.server.expect(requestTo(...uri...)) .andResponse(withSuccess(...body..., ...media type...)); }
Test usando Wiremock @AutoconfigureWireMock public class WireMockTest { @Test public
void shouldReturnAllItems() { stubFor( get(urlEqualTo(...uri...)) .willReturn( aResponse() .withHeader(...key..., ...value...) .withBody(...body...))); }
Consumer Driven Contracts
Términos • Productor • Consumidor • Contrato
Spring Cloud Contract
Beneficios de Spring Cloud Contract Por lado del Productor: •
Ofrece DSL para definir contratos • Genera stubs • Genera tests a partir de la definición de contratos
Beneficios de Spring Cloud Contract Por lado del Consumidor: •
Validación contra los contratos • Ejecución de tests contra stubs generados por el Productor gracias a StubRunner
Demo
Features • Soporta mensajería (Integration, Stream, RabbitMQ, Kafka, Camel) •
Integración con MockMvc • Integración con WebTestClient • Integración con RestDocs • Soporte para Maven y Gradle • Provee StubRunner • Provee reglas en JUnit 4 y extensiones en JUnit Jupiter • Soporta Pact • Definición de contratos a través de YAML
Recursos • https://github.com/eddumelendez/jconfcolombia19-demo • https://cloud.spring.io/spring-cloud-static/spring-cloud-contract/2.2.0.M1
Gracias! https://blog.eddumelendez.me / Twitter/Github: eddumelendez