5. @mogronalol 3
Agenda
• The problems with operating and testing distributed
systems and microservices
• Overview of Service Virtualisation / Api Simulation
6. @mogronalol 3
Agenda
• The problems with operating and testing distributed
systems and microservices
• Overview of Service Virtualisation / Api Simulation
• Improving our Tests
7. @mogronalol 3
Agenda
• The problems with operating and testing distributed
systems and microservices
• Overview of Service Virtualisation / Api Simulation
• Improving our Tests
• Data Synchronisation
8. @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
9. @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
18. @mogronalol 9
Airline Booking Application
• Microservice architecture
• Integration with third party services
• Integration with legacy internal services
19. @mogronalol 9
Airline Booking Application
• Microservice architecture
• Integration with third party services
• Integration with legacy internal services
• Heavy resource consumption
20. @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
57. @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
90. @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
97. @mogronalol 29
JUnit Example
@Test
public 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));
}
98. @mogronalol 29
JUnit Example
@Rule
public HoverflyRule hoverflyRule = HoverflyRule.inCaptureMode(“src/test/
resources/external.json").build();
@Test
public 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));
}
100. @mogronalol 31
JUnit Example
@Test
public 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();
135. @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
155. @mogronalol 46
Virtual Service as First Class Citizen
Run and
Capture
Service Tests
Transform to
simulation
Publish
Virtual
Service
156. @mogronalol 46
Virtual Service as First Class Citizen
Run and
Capture
Service Tests
Parse
Contract
Transform to
simulation
Publish
Virtual
Service
157. @mogronalol 46
Virtual Service as First Class Citizen
Run and
Capture
Service Tests
Parse
Contract
Transform to
simulation
Parse
Documentati
on
Publish
Virtual
Service
159. @mogronalol 47
Ownership
Own Consumer Own Producer Strategy
Integration
Contract Testing
Consumer Driven
Contract Testing
Virtual Service as
First Class Citizen
182. @mogronalol 52
Summary
• Cost reduction from simulated services
• Easy deployment of simulations
• Less dependant on end to end testing
183. @mogronalol 52
Summary
• Cost reduction from simulated services
• Easy deployment of simulations
• Less dependant on end to end testing
• Better feedback cycle