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
62
Intro to Spring Boot
eddumelendez
0
94
Other Decks in Programming
See All in Programming
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
460
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
210
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.4k
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
280
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
430
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
モダンOBSプラグイン開発
umireon
0
190
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
390
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
Feature Toggle は捨てやすく使おう
gennei
0
400
ファインチューニングせずメインコンペを解く方法
pokutuna
0
250
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
24k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
290
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
470
For a Future-Friendly Web
brad_frost
183
10k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
300
Design in an AI World
tapps
0
190
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
230
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
How to build a perfect <img>
jonoalderson
1
5.3k
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