How to e2e test microservices? If tested in isolation, how to handle api-contracts between services?



e2e testing is more functional testing if you ask me. So you should be e2e testing the functionality of your system as a whole.

This is how I would go about e2e testing multiple micro services. At the end of the day your code needs to do something of value so test that whole flow entirely. Unit test your microservices.


if you test a microservice in isolation then you can either:

a) mock up the other service

b) do e2e testing on your system as a whole

e2e testing is a synonym for functional testing. You are testing the end behavior and functionality of what your application or system is meant to do. If your application involves hitting 3-4 other microservices to get shared data then you can mock up the service to return what you expect....however this becomes more like a unit test.


to e2e test your system, you want to make sure that system A and system B do what they are supposed to as a system. I understand your point in that you can e2e test a microservice to make sure it handles test inputs correctly. but how do you test a live connection to that microservice ..hitting it in real time?

i suppose this isn't too difficult with most testing frameworks etc...but a valid point for discussion :)


i find your question ironic as e2e testing is exactly how you test microservices working together