Our external-service testing story has two main characters:
The client, the part of our application code that uses the external API, either because it needs data accessible via the API or because it is sending data to the API to be used by somebody else. In either case, we’re dealing with a request and a response, even if the response is just a status code.
The server, which for our purposes is outside our application and reachable via some kind of network request (though many of the strategies in this chapter also apply even if the service isn’t separated by the network).
We also introduce two characters to the story for design and testing purposes:
* A fake server, which intercepts HTTP requests during a test and ...