Hexagonal Architecture - Adapter Testing
How should we test adapters? Should we use "integrated" or "isolated" tests?
When I read Alistair’s original article Hexagonal Architecture, I noticed only one type of test mentioned in the diagram - the “test harness adapter“ which targets the user-side API, i.e. targeting the driving ports.
Testing driving ports (spanning the hexagon in isolation) had a clear value - providing regression bug protection in business logic.
📢 My next Live Q&A Session about Unit Tests is on Wed 30th April 17:00. If you’re an Optivem Journal paid member, get your 100% discount ticket.
Upgrade to join the Live Q&A for free:
But what about testing adapters, e.g. testing database adapters, file adapters, external system adapters?
Should adapters be tested, are they worthy of being tested?
If adapters should be tested, should we test them in an integrated way or in an isolated way?