Boundary tests come in two forms, each with their own goal—internal-facing and external-facing.
Internal-facing boundary tests are designed to validate two things:
- That our code calls the external service in the way that we expect it to
- That our code reacts to all responses, happy path and errors, from the external service in the way that we expect it to
As such, internal-facing boundary tests do not interact with the external service, but rather with a mock or stub implementation of the external service.
External-facing boundary tests are the opposite. They interact with the external service and verify that the external service performs as we need it to. Please note that they do not validate the external service's API contract, ...