simulating apis for effective testing: (micro)service ......simulating apis for effective testing:...
TRANSCRIPT
![Page 1: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/1.jpg)
@mogronalol
Simulating APIs for Effective Testing: (Micro)Service Virtualisation
1
Andrew Morgan @mogronalol
OpenCredo & Spectolabs
![Page 2: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/2.jpg)
@mogronalol 2
About Me
• Consultant at OpenCredo • Background mainly with
Java and now Go • Spectolabs
Andrew Morgan @mogronalol
![Page 3: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/3.jpg)
@mogronalol 3
Agenda
![Page 4: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/4.jpg)
@mogronalol 3
Agenda
• The problems with operating and testing distributed systems and microservices
![Page 5: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/5.jpg)
@mogronalol 3
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation
![Page 6: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/6.jpg)
@mogronalol 3
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation• Improving our Tests
![Page 7: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/7.jpg)
@mogronalol 3
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation• Improving our Tests• Data Synchronisation
![Page 8: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/8.jpg)
@mogronalol 3
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation• Improving our Tests• Data Synchronisation• Summary
![Page 9: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/9.jpg)
@mogronalol 4
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation • Improving our Tests • Data Synchronisation • Summary
![Page 10: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/10.jpg)
@mogronalol
-INFOX
5
Distributed Systems
![Page 11: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/11.jpg)
@mogronalol
Microservices
6
Payment
Company
Booking
Flights
Auth
![Page 12: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/12.jpg)
@mogronalol
Microservices
6
Payment
Company
Booking
Flights
Auth
![Page 13: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/13.jpg)
@mogronalol
A natural evolution...
7
![Page 14: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/14.jpg)
@mogronalol
Challenges…
8
![Page 15: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/15.jpg)
@mogronalol 9
Airline Booking Application
![Page 16: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/16.jpg)
@mogronalol 9
Airline Booking Application
• Microservice architecture
![Page 17: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/17.jpg)
@mogronalol 9
Airline Booking Application
• Microservice architecture• Integration with third party services
![Page 18: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/18.jpg)
@mogronalol 9
Airline Booking Application
• Microservice architecture• Integration with third party services• Integration with legacy internal services
![Page 19: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/19.jpg)
@mogronalol 9
Airline Booking Application
• Microservice architecture• Integration with third party services• Integration with legacy internal services• Heavy resource consumption
![Page 20: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/20.jpg)
@mogronalol 9
Airline Booking Application
• Microservice architecture• Integration with third party services• Integration with legacy internal services• Heavy resource consumption• A standard CI/CD pipeline
![Page 21: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/21.jpg)
@mogronalol 10
Resources
![Page 22: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/22.jpg)
@mogronalol 10
Resources
Booking
![Page 23: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/23.jpg)
@mogronalol 10
Resources
Booking
Flights
![Page 24: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/24.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
![Page 25: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/25.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
![Page 26: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/26.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
Fraud
![Page 27: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/27.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
Fraud
![Page 28: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/28.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
Fraud
![Page 29: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/29.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
Fraud
![Page 30: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/30.jpg)
@mogronalol 10
Resources
Booking
Flights
Rewards
Payments
Fraud
Cost
![Page 31: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/31.jpg)
@mogronalol 11
![Page 32: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/32.jpg)
@mogronalol 12
Licensing
![Page 33: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/33.jpg)
@mogronalol 12
Licensing
Consumer
Producer
![Page 34: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/34.jpg)
@mogronalol 12
Licensing
Consumer
Producer
Third party
![Page 35: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/35.jpg)
@mogronalol 12
Licensing
Consumer
Producer
Consumer
Producer
Third party
![Page 36: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/36.jpg)
@mogronalol 12
Licensing
Consumer
Producer
Consumer
Producer
Third party Cost
![Page 37: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/37.jpg)
@mogronalol 13
Dependency Constraints
![Page 38: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/38.jpg)
@mogronalol 13
Dependency Constraints
Consumer
Producer
![Page 39: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/39.jpg)
@mogronalol 13
Dependency Constraints
Consumer
Producer
![Page 40: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/40.jpg)
@mogronalol 13
Dependency Constraints
Consumer
Producer
Consumer
Producer
![Page 41: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/41.jpg)
@mogronalol 14
Flakey Dependencies
![Page 42: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/42.jpg)
@mogronalol 14
Flakey Dependencies
Consumer
Producer
![Page 43: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/43.jpg)
@mogronalol 14
Flakey Dependencies
Consumer
Producer
Consumer
Producer
![Page 44: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/44.jpg)
@mogronalol 15
Doesn't exist
![Page 45: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/45.jpg)
@mogronalol 15
Doesn't exist
Consumer
?
![Page 46: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/46.jpg)
@mogronalol 16
Non Deterministic
![Page 47: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/47.jpg)
@mogronalol 16
Non Deterministic
Consumer
Booking Service
![Page 48: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/48.jpg)
@mogronalol 16
Non Deterministic
Consumer
Booking Service {
“date” : “2013-01-08”, … }
![Page 49: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/49.jpg)
@mogronalol 16
Non Deterministic
assertThat(booking.getDate()) .isEqualTo(LocalDate.of(2013,1,8));
Consumer
Booking Service {
“date” : “2013-01-08”, … }
![Page 50: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/50.jpg)
@mogronalol 16
Non Deterministic
assertThat(booking.getDate()) .isEqualTo(LocalDate.of(2013,1,8));
Consumer
Booking Service {
“date” : “2013-01-08”, … }
![Page 51: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/51.jpg)
@mogronalol 16
Non Deterministic
assertThat(booking.getDate()) .isEqualTo(LocalDate.of(2013,1,8));
Consumer
Booking Service {
“date” : “2016-02-07”, … }
![Page 52: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/52.jpg)
@mogronalol 17
Fault Injection
![Page 53: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/53.jpg)
@mogronalol 17
Fault Injection
Consumer
Producer
![Page 54: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/54.jpg)
@mogronalol 17
Fault Injection
Consumer
Producer
Consumer
Producer
![Page 55: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/55.jpg)
@mogronalol 17
Fault Injection
Consumer
Producer
Consumer
Producer
4xx, 5xx, timeouts
![Page 56: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/56.jpg)
@mogronalol 17
Fault Injection
Consumer
Producer
Consumer
Producer
4xx, 5xx, timeouts
Operationally challenging to trigger
faults
![Page 57: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/57.jpg)
@mogronalol 18
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation • Improving our Tests • Data Synchronisation • Summary
![Page 58: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/58.jpg)
@mogronalol 19
Service Virtualisation
![Page 59: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/59.jpg)
@mogronalol 19
Service Virtualisation
• Emulation of real service
![Page 60: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/60.jpg)
@mogronalol 19
Service Virtualisation
• Emulation of real service• Non-intrusive
![Page 61: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/61.jpg)
@mogronalol 19
Service Virtualisation
• Emulation of real service• Non-intrusive• Lightweight - or should be
![Page 62: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/62.jpg)
@mogronalol 20
Service Virtualisation
![Page 63: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/63.jpg)
@mogronalol 20
Service Virtualisation
Consumer
![Page 64: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/64.jpg)
@mogronalol 20
Service Virtualisation
Consumer Producer
![Page 65: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/65.jpg)
@mogronalol 20
Service Virtualisation
Consumer Virtual Producer
![Page 66: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/66.jpg)
@mogronalol 21
Creating Data
![Page 67: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/67.jpg)
@mogronalol 21
Creating Data
Consumer
![Page 68: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/68.jpg)
@mogronalol 21
Creating Data
Consumer Producer
![Page 69: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/69.jpg)
@mogronalol 21
Creating Data
Consumer ProducerService
Virtualisation Tool
![Page 70: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/70.jpg)
@mogronalol 22
Creating Data
https://github.com/tomakehurst/wiremock
![Page 71: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/71.jpg)
@mogronalol 23
Proxy Mode
![Page 72: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/72.jpg)
@mogronalol 23
Proxy Mode
Consumer
![Page 73: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/73.jpg)
@mogronalol 23
Proxy Mode
Consumer Producer
![Page 74: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/74.jpg)
@mogronalol 23
Proxy Mode
Consumer ProducerService
Virtualisation Tool
![Page 75: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/75.jpg)
@mogronalol 24
Webserver / Facade Mode
![Page 76: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/76.jpg)
@mogronalol 24
Webserver / Facade Mode
Consumer
![Page 77: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/77.jpg)
@mogronalol 24
Webserver / Facade Mode
Consumer Producer
![Page 78: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/78.jpg)
@mogronalol 24
Webserver / Facade Mode
Consumer Producer
![Page 79: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/79.jpg)
@mogronalol 24
Webserver / Facade Mode
Consumer Producer
Service Virtualisation
Tool
![Page 80: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/80.jpg)
@mogronalol 24
Webserver / Facade Mode
Consumer Producer
Service Virtualisation
Tool
![Page 81: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/81.jpg)
@mogronalol 25
Not Mocking
Service Under Test
Dependant Service
Http
![Page 82: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/82.jpg)
@mogronalol 25
Not Mocking
Service Under Test
Mocking
Dependant Service
Http
![Page 83: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/83.jpg)
@mogronalol 25
Not Mocking
Service Under Test
Mocking
![Page 84: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/84.jpg)
@mogronalol 25
Not Mocking
Service Under Test
Virtual Service
![Page 85: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/85.jpg)
@mogronalol 25
Not Mocking
Service Under Test
Virtual Service
Mocks bleed into the architectural boundary of your
application
![Page 86: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/86.jpg)
@mogronalol 26
Open Source Tooling
![Page 87: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/87.jpg)
@mogronalol 26
Open Source Tooling
![Page 88: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/88.jpg)
@mogronalol 26
Open Source Tooling
![Page 89: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/89.jpg)
@mogronalol 26
Open Source Tooling
![Page 90: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/90.jpg)
@mogronalol 27
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation • Improving our Tests • Data Synchronisation • Summary
![Page 91: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/91.jpg)
@mogronalol 28
Record and replay
![Page 92: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/92.jpg)
@mogronalol 28
Record and replay
Consumer
![Page 93: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/93.jpg)
@mogronalol 28
Record and replay
Consumer External Producer
![Page 94: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/94.jpg)
@mogronalol 28
Record and replay
Consumer External Producer
Service Virtualisati
on Tool
![Page 95: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/95.jpg)
@mogronalol 28
Record and replay
Consumer External Producer
Service Virtualisati
on Tool
![Page 96: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/96.jpg)
@mogronalol 29
JUnit Example
![Page 97: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/97.jpg)
@mogronalol 29
JUnit Example
@Testpublic void shouldBeAbleToRetrieveABooking() throws URISyntaxException { // Given final int bookingId = 1; // When final Booking booking = bookingServiceGateway.getBooking(bookingId); // Then assertThat(booking.getCustomer()).isEqualTo(“Andrew Morgan”); assertThat(booking.getDate()).isEqualTo(LocalDate.of(2016,3,1));}
![Page 98: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/98.jpg)
@mogronalol 29
JUnit Example
@Rule public HoverflyRule hoverflyRule = HoverflyRule.inCaptureMode(“src/test/resources/external.json").build();
@Testpublic void shouldBeAbleToRetrieveABooking() throws URISyntaxException { // Given final int bookingId = 1; // When final Booking booking = bookingServiceGateway.getBooking(bookingId); // Then assertThat(booking.getCustomer()).isEqualTo(“Andrew Morgan”); assertThat(booking.getDate()).isEqualTo(LocalDate.of(2016,3,1));}
![Page 99: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/99.jpg)
@mogronalol 30
JUnit Example{ "data": [ { "request": { "path": "/api/bookings/1", "method": "GET", "destination": "www.my-test.com", "query": null, "body": "" }, "response": { "status": 200, "body": “{\”customer\”:\”Andrew Morgan\", \”date\”: \”2016-03-01\”}}}”, "headers": { "Content-Type": [ "application/json" ] } } } ]}
![Page 100: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/100.jpg)
@mogronalol 31
JUnit Example
@Testpublic void shouldBeAbleToRetrieveABooking() throws URISyntaxException { // Given final int bookingId = 1; // When final Booking booking = bookingServiceGateway.getBooking(bookingId); // Then assertThat(booking.getCustomer()).isEqualTo(“Andrew Morgan”); assertThat(booking.getDate()).isEqualTo(LocalDate.of(2016,3,1));}
@Rule public HoverflyRule hoverflyRule = HoverflyRule.buildFromClassPathResource(“external.json").build();
![Page 101: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/101.jpg)
@mogronalol 32
Advantages
![Page 102: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/102.jpg)
@mogronalol 32
Advantages
• Isolation
![Page 103: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/103.jpg)
@mogronalol 32
Advantages
• Isolation• Flaky dependencies
![Page 104: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/104.jpg)
@mogronalol 32
Advantages
• Isolation• Flaky dependencies• Rate limiting
![Page 105: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/105.jpg)
@mogronalol 32
Advantages
• Isolation• Flaky dependencies• Rate limiting• Deterministic
![Page 106: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/106.jpg)
@mogronalol 32
Advantages
• Isolation• Flaky dependencies• Rate limiting• Deterministic• Licensing
![Page 107: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/107.jpg)
@mogronalol 33
Deployment and Infrastructure
![Page 108: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/108.jpg)
@mogronalol 33
Deployment and Infrastructure
Consumer External Producer
![Page 109: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/109.jpg)
@mogronalol 33
Deployment and Infrastructure
Consumer External Producer
Internal Producer
Internal Producer
Internal Producer
![Page 110: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/110.jpg)
@mogronalol 33
Deployment and Infrastructure
Consumer
Virtual Service
Virtual Service
Virtual Service
Virtual Service
![Page 111: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/111.jpg)
@mogronalol 34
CLI Example
![Page 112: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/112.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080
![Page 113: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/113.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080$ hoverctl import accounts-service-simulation.json
![Page 114: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/114.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080$ hoverctl import accounts-service-simulation.json
$ hoverctl start —proxy-port 8081
![Page 115: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/115.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080$ hoverctl import accounts-service-simulation.json
$ hoverctl start —proxy-port 8081$ hoverctl import payments-service-simulation.json
![Page 116: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/116.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080$ hoverctl import accounts-service-simulation.json
$ hoverctl start —proxy-port 8081$ hoverctl import payments-service-simulation.json
$ curl http://www.account-service.com/api/v1/accounts/1 —proxy http://localhost:8080
[{"name":"foo"}]
![Page 117: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/117.jpg)
@mogronalol 34
CLI Example
$ hoverctl start —proxy-port 8080$ hoverctl import accounts-service-simulation.json
$ hoverctl start —proxy-port 8081$ hoverctl import payments-service-simulation.json
$ curl http://www.account-service.com/api/v1/accounts/1 —proxy http://localhost:8080
[{"name":"foo"}]
$ curl http://www.payment-service.com/api/v1/payments/1 -proxy http://localhost:8081
[{“amount":"£23.27"}]
![Page 118: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/118.jpg)
@mogronalol 35
![Page 119: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/119.jpg)
@mogronalol 36
Fault Injection
![Page 120: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/120.jpg)
@mogronalol 36
Fault Injection
Consumer External Producer
Service Virtualisation
Tool
![Page 121: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/121.jpg)
@mogronalol 36
Fault Injection
Consumer External Producer
Service Virtualisation
Tool
Middleware
![Page 122: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/122.jpg)
@mogronalol 37
Fault Injection
![Page 123: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/123.jpg)
@mogronalol 38
Advantages
![Page 124: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/124.jpg)
@mogronalol 38
Advantages
• Transparent
![Page 125: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/125.jpg)
@mogronalol 38
Advantages
• Transparent• Configurable
![Page 126: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/126.jpg)
@mogronalol 38
Advantages
• Transparent• Configurable• Operationally simple
![Page 127: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/127.jpg)
@mogronalol 39
Documentation-Driven
![Page 128: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/128.jpg)
@mogronalol 39
Documentation-Driven
Consumer ?
![Page 129: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/129.jpg)
@mogronalol 39
Documentation-Driven
Consumer
![Page 130: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/130.jpg)
@mogronalol 39
Documentation-Driven
Consumer
Transform
![Page 131: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/131.jpg)
@mogronalol
Virtual Service
39
Documentation-Driven
Consumer
Transform
![Page 132: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/132.jpg)
@mogronalol 40
Advantages
![Page 133: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/133.jpg)
@mogronalol 40
Advantages
• Documentation Driven Development
![Page 134: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/134.jpg)
@mogronalol 40
Advantages
• Documentation Driven Development• Work in Parallel
![Page 135: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/135.jpg)
@mogronalol 41
Agenda
• The problems with operating and testing distributed systems and microservices
• Overview of Service Virtualisation / Api Simulation • Improving our Tests • Data Synchronisation • Summary
![Page 136: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/136.jpg)
@mogronalol 42
Data Synchronisation Issues
![Page 137: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/137.jpg)
@mogronalol 42
Data Synchronisation Issues
Consumer Virtual Service
![Page 138: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/138.jpg)
@mogronalol 42
Data Synchronisation Issues
ConsumerConsumer Virtual Service
![Page 139: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/139.jpg)
@mogronalol 42
Data Synchronisation Issues
ConsumerConsumerConsumer Real Service
![Page 140: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/140.jpg)
@mogronalol 43
Ownership
![Page 141: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/141.jpg)
@mogronalol 43
Ownership
Own Consumer Own Producer Strategy
![Page 142: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/142.jpg)
@mogronalol 43
Ownership
Own Consumer Own Producer Strategy
Integration Contract Testing
![Page 143: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/143.jpg)
@mogronalol 44
Integration Contract Testing
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 144: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/144.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 145: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/145.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
Reproduce Simulations
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 146: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/146.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
Reproduce Simulations Diff
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 147: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/147.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
Reproduce Simulations Diff
Integration Testing or
Contract Diff
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 148: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/148.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
Reproduce Simulations Diff
No diff?
Integration Testing or
Contract Diff
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 149: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/149.jpg)
@mogronalol 44
Integration Contract Testing
Scheduled Build
Reproduce Simulations Diff
No diff?
Diff?
Integration Testing or
Contract Diff
http://martinfowler.com/bliki/IntegrationContractTest.html
![Page 150: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/150.jpg)
@mogronalol 45
Ownership
Own Consumer Own Producer Strategy
Integration Contract Testing
![Page 151: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/151.jpg)
@mogronalol 45
Ownership
Own Consumer Own Producer Strategy
Integration Contract Testing
Virtual Service as First Class Citizen
![Page 152: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/152.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
![Page 153: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/153.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
Run and Capture
Service Tests
![Page 154: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/154.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
Run and Capture
Service Tests
Transform to simulation
![Page 155: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/155.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
Run and Capture
Service Tests
Transform to simulation
Publish Virtual Service
![Page 156: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/156.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
Run and Capture
Service Tests
Parse Contract
Transform to simulation
Publish Virtual Service
![Page 157: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/157.jpg)
@mogronalol 46
Virtual Service as First Class Citizen
Run and Capture
Service Tests
Parse Contract
Transform to simulation
Parse Documentati
on
Publish Virtual Service
![Page 158: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/158.jpg)
@mogronalol 47
Ownership
Own Consumer Own Producer Strategy
Integration Contract Testing
Virtual Service as First Class Citizen
![Page 159: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/159.jpg)
@mogronalol 47
Ownership
Own Consumer Own Producer Strategy
Integration Contract Testing
Consumer Driven Contract Testing
Virtual Service as First Class Citizen
![Page 160: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/160.jpg)
@mogronalol 48
Consumer Driven Contract Testing
http://www.martinfowler.com/articles/consumerDrivenContracts.html
![Page 161: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/161.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
http://www.martinfowler.com/articles/consumerDrivenContracts.html
![Page 162: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/162.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
![Page 163: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/163.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Implement Consumer
![Page 164: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/164.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Implement Consumer
![Page 165: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/165.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Generate Producer Contract
Tests
Implement Consumer
![Page 166: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/166.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
Implement Producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Generate Producer Contract
Tests
Implement Consumer
![Page 167: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/167.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
Implement Producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Generate Producer Contract
Tests
Implement Consumer
Run Consumer Contract
Tests
![Page 168: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/168.jpg)
@mogronalol 48
Consumer Driven Contract Testing
Consumer Defines Contract
Implement Producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Generate Producer
Stubs
Generate Producer Contract
Tests
Implement Consumer
Run Consumer Contract
Tests
![Page 169: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/169.jpg)
@mogronalol 49
Consumer Driven Contract Testing
http://www.martinfowler.com/articles/consumerDrivenContracts.html
![Page 170: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/170.jpg)
@mogronalol 49
Consumer Driven Contract Testing
Change producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
![Page 171: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/171.jpg)
@mogronalol 49
Consumer Driven Contract Testing
Change producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Run Consumer Contract
Tests
![Page 172: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/172.jpg)
@mogronalol 49
Consumer Driven Contract Testing
Change producer
http://www.martinfowler.com/articles/consumerDrivenContracts.html
Run Consumer Contract
Tests
![Page 173: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/173.jpg)
@mogronalol 50
Tools
![Page 174: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/174.jpg)
@mogronalol 50
Tools
![Page 175: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/175.jpg)
@mogronalol 50
Tools
![Page 176: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/176.jpg)
@mogronalol 51
Testing Pyramid
End to end
Integration / Service Testing
Unit Testing
![Page 177: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/177.jpg)
@mogronalol 51
Testing Pyramid
End to end
Integration / Service Testing
Unit Testing
Consumer Driven Contract Testing
![Page 178: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/178.jpg)
@mogronalol 51
Testing Pyramid
End to end
Integration / Service Testing
Unit Testing
Consumer Driven Contract Testing
![Page 179: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/179.jpg)
@mogronalol 52
Summary
![Page 180: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/180.jpg)
@mogronalol 52
Summary
• Cost reduction from simulated services
![Page 181: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/181.jpg)
@mogronalol 52
Summary
• Cost reduction from simulated services• Easy deployment of simulations
![Page 182: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/182.jpg)
@mogronalol 52
Summary
• Cost reduction from simulated services• Easy deployment of simulations• Less dependant on end to end testing
![Page 183: Simulating APIs for Effective Testing: (Micro)Service ......Simulating APIs for Effective Testing: (Micro)Service Virtualisation 1 Andrew Morgan @mogronalol OpenCredo & Spectolabs](https://reader036.vdocuments.site/reader036/viewer/2022062505/5ee11f7aad6a402d666c1e7f/html5/thumbnails/183.jpg)
@mogronalol 52
Summary
• Cost reduction from simulated services• Easy deployment of simulations• Less dependant on end to end testing• Better feedback cycle