An example setup for a Spring Boot webservice using ArchUnit to verify architectural contraints.
The package structure was inpired by two blog posts:
Note that ArchUnit also allows to define an Onion Architecture, which can be combined with the mechanism used here.
The annotations for the Sprint Boot tests are chosen with the goal in mind to require as few beans as possible, while still using the auto-configuration mechanism provided by Spring Boot.