I read couple articles about Consumer Contract Testing, but I cannot find answer to one question.
Let's say I have 3 microservices: A, B, C. The communication looks like that:
A -> B -> C
Now I want to test contract between A and B. Should I start services B and C or only B in mocked/stubbed mode?
A
andB
, ignoring everything else in the application, then theC
component ofB
should be mocked. If you want to test the interaction between the classesA
andB
with respect to the classC
, the classC
service should be part of the process as well. However, most integration tests are written to make sure all your wiring works. If you wanna run integration tests, you should not be mocking any dependencies. – Andy Apr 08 '16 at 11:28