Microservices architecture has changed how companies develop and deploy applications. This change has affected testing process as well. New techniques have emerged and others have been enhanced.
Come to this session to learn about service virtualization, contract testing or testing in production to increase deployment velocity from 1 week to N times per day or deploy each service independently without worrying about breaking the compatibility between services anymore.
17. @alexsotob17
@Mock EmailService email;
Mockito.when(email.receiveBodyMessagesWithSubject("My Subject”))
.thenReturn("This is My Message")
// Test calls
Mockito.verify(email, Mockito.times(1))
.receiveBodyMessagesWithSubject(Matchers.anyString());
@ClassRule
public static HoverflyRule hoverflyRule =
HoverflyRule.inSimulationMode(SimulationSource.dsl(
service("api.flight.com")
.get("/api/bookings/1")
.willReturn(success("{"bookingId":"1"}", "application/json"))
));
// Test calls
hoverfly.verify(
service(matches("*.flight.*"))
.get("/api/bookings")
.anyQueryParams());
Record Method Expectation
Verify Method Called
Record Service Expectation
Verify Service Called