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
0
100
Consumer Driven Contract Testing con Spring Cloud Contract
Eddú Meléndez Gonzales
July 06, 2019
Tweet
Share
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
330
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
220
SpringOne Recap
eddumelendez
0
57
Intro to Spring Boot
eddumelendez
0
92
Other Decks in Programming
See All in Programming
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
870
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
110
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
600
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
330
技術同人誌をMCP Serverにしてみた
74th
1
440
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
150
CursorはMCPを使った方が良いぞ
taigakono
1
190
NPOでのDevinの活用
codeforeveryone
0
450
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
130
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
950
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
150
Select API from Kotlin Coroutine
jmatsu
1
190
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Designing Experiences People Love
moore
142
24k
Practical Orchestrator
shlominoach
188
11k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Fireside Chat
paigeccino
37
3.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
Embracing the Ebb and Flow
colly
86
4.7k
Bash Introduction
62gerente
614
210k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
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