Slide 1

Slide 1 text

Acceptance testing in the microservices world Dimos Raptis @dimor7 [email protected]

Slide 2

Slide 2 text

An abstract view of software composition Class A Class B Class C

Slide 3

Slide 3 text

In the microservices world Service B Service C DB DB Service A Component A Component C Class 1 Class 2 Class 3 Class 3 Component B

Slide 4

Slide 4 text

Testing Service B Service C DB DB Service A Component A Component C Class 1 Class 2 Class 3 Class 3 Component B

Slide 5

Slide 5 text

An example Dependent Service 1 Dependent Service 2 Service 1 Gateway Service 2 Gateway Controller Component Component Component Component Component

Slide 6

Slide 6 text

Dependency Injection Controller Gateway A Gateway B Gateway C

Slide 7

Slide 7 text

public class AcceptanceTest { ServiceAGateway gatewayA; ServiceBGateway gatewayB; Controller controller; @Before public void setup() { //setup test data for dependency A //setup test data for dependency B … } @Test public void test() { response = controller.execute(request); //assertions on response } } ApplicationConfig GatewaysConfig StubGatewaysConfig import Production profile Test profile

Slide 8

Slide 8 text

The value of integration testing Consumer-Driven Contract testing (CDC)

Slide 9

Slide 9 text

Relevant resources Blog post: https://dimosr.github.io/acceptance-tests-with-spring Code prototype: https://github.com/dimosr/acceptance-testing-demo

Slide 10

Slide 10 text

Thank you! Dimos Raptis @dimor7 [email protected]