Boundary tests

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, ...

Get Hands-On Dependency Injection in Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.