20. Hexagonal architecture
Application
(domain)
driven side
driving side
Driving
adapter
Driving
adapter
Driven
adapter
Driven
adapter
Driving
port
Driving
port
Driven
port
Driven
port
(aka Controllers)
(aka use cases / services)
(aka repository / api proxy
interfaces)
(aka repository / api proxy
implementations)
22. Driving adapters
(aka controllers)
Low level implementation of APIs, listeners, etc to get commands, queries
or events from the outside to the driving ports in the hexagon.
24. Driving ports
(aka services, use cases, interactors)
Domain interface of the app used by the driving adapters to pass
commands, queries and events in the language of the domain.
25. Driven ports
(aka repositories, api proxies)
Domain abstraction of the capabilities of external systems used by the
application.
26. Driven adapters
(aka data sources)
Low level implementation of the interfaces of driven ports that use
speci
f
ic external services or technologies (e.g. a PostgreSql database).
30. AAA with state
Stateful components
1. Arrange inputs & initial state
2. Act
3. Assert outputs &
f
inal state
https://blog.agilogy.com/2022-06-17-testing-and-persistent-state.html
32. In-memory production-ready test fakes
Alternatives
Test in integration with Isolated, production(-like) external systems
You test the actual component
Slow
Use mocks and stubs
You test the behaviour of the system, not the outcome
35. Test all the domain
Broad test of all the components that
form the domain
Whole domain
Through (driver) ports (controllers)
Use AAA with state
36. A. Test with In-memory,
production-ready test fakes
(preferred)
B. Test in integration with
Isolated, production(-like)
external systems (slower)
Test all the domain
alternatives
41. Test test fakes
Make In-memory, production-ready
tests fakes production-ready indeed:
Parameterize Integration tests
Run the same test suite for both