Chapter 9. Service virtualization
This chapter covers
- Appreciating service virtualization
- Simulating internal and external services
- Understanding service virtualization and Java
In a microservices architecture, the application as a whole can be composed of many interconnected services. These services can be either internal services, as in members of the same application domain, or external, third-party services that are totally out of your control.
As you’ve seen throughout the book, this approach implies that some changes are required when continuous application testing is part of your delivery pipeline. Back in chapter 7, we observed that one of the biggest challenges faced when testing a microservices architecture is having a clean test environment readily available. Getting multiple services up, running, and prepared is no trivial task. It takes time to prepare and execute tests, and it’s highly likely that you’ll end up with several flaky tests—tests that fail not due to code issues, but because of a failures within the testing environment. One of the techniques you can adopt to fix this is service virtualization.