As an example, I recently had a dependency on a remote Authorization service to validate user access tokens. But then I wrote a service that didn't need Authorization -- it just made calculations. So I implemented the AuthorizationService interface (name changed to protect innocent services) with a NoAuthorizationService that just returned true
for validate(token)
.
I could use that same stub interface to stub out calls to the actual Authorization service. But I considered it a production artifact rather than a test artifact, because I could use that for a live service to plug into if I didn't want to otherwise disable calls to that service.
Think of "127.0.0.1", the loopback IP -- it just goes to localhost. It's a similar idea in a hexagonal architecture, where calls to a remote service are just looping back to the local service instead.
...
In the more common Gang Of Four lingo, this would be the Null Object pattern. Or else a "sentinel" object that takes the place of the real thing but doesn't do anything.