Summary
Testing against external systems is expensive! One problem is that setting up the external system in a known state is hard, especially when testing against a third-party system that is not under our control. The other problem is that they can be slow due to connectivity problems.
We can do the setup and assertions using a low-level API or the provided client library directly. This approach generates duplication of code between the test and the production codebase. Instead, I often prefer to use this kind of low-level API only for setup and then write the tests of the DAO, or custom service client, using the read methods of the DAO to write assertions.
If you are testing against a web API, then using the record-and-replay approach is usually ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access