In this chapter, I have been talking exclusively about databases because database is the most common part of a system where you would want to perform the integration test. The database is often part of your system design and a unit in the solution architecture. Web services are in our architecture just as often internal to our systems as hosted externally by a third party.
This leads us to the question: should we test external web services?
Most of the time, you should not care about testing external services. If there is a well-defined API that feels stable, it is not your responsibility to cover it with tests.
However, if the external API is developed as a part of your solution, there could be a huge benefit for you to write a set of integration tests that will define the contract of what your application is expecting from the API and hand it over to a third party. They can use these tests to verify that your client will work together with their implementation. This way...