Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Acceptance Testing in the microservices world

Dimos Raptis
September 04, 2018

Acceptance Testing in the microservices world

Microservices is being widely adopted as an architectural pattern during the last decade thanks to the business agility it enables. This pattern incentivises teams owning separate business domains to move as independently as possible. However, the need remains to test and verify that all these services will work as expected in cooperation. This can end up being harder at times given there are more moving parts that need to be setup appropriately in order to perform the necessary testing. This talk is essentially a story from the trenches, which goes through some of the challenges we faced with testing in a microservices environment and how we overcame some of them.

Dimos Raptis

September 04, 2018
Tweet

More Decks by Dimos Raptis

Other Decks in Technology

Transcript

  1. 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
  2. Testing Service B Service C DB DB Service A Component

    A Component C Class 1 Class 2 Class 3 Class 3 Component B
  3. An example Dependent Service 1 Dependent Service 2 Service 1

    Gateway Service 2 Gateway Controller Component Component Component Component Component
  4. 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