Add ArchUnit rule: web adapter must not depend on outbound ports
Prevents future regressions where controllers bypass the application layer and access repositories directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,4 +60,9 @@ class HexagonalArchitectureTest {
|
|||||||
static final ArchRule persistenceMustNotDependOnWeb = noClasses()
|
static final ArchRule persistenceMustNotDependOnWeb = noClasses()
|
||||||
.that().resideInAPackage("de.fete.adapter.out.persistence..")
|
.that().resideInAPackage("de.fete.adapter.out.persistence..")
|
||||||
.should().dependOnClassesThat().resideInAPackage("de.fete.adapter.in.web..");
|
.should().dependOnClassesThat().resideInAPackage("de.fete.adapter.in.web..");
|
||||||
|
|
||||||
|
@ArchTest
|
||||||
|
static final ArchRule webAdapterMustNotDependOnOutboundPorts = noClasses()
|
||||||
|
.that().resideInAPackage("de.fete.adapter.in.web..")
|
||||||
|
.should().dependOnClassesThat().resideInAPackage("de.fete.domain.port.out..");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user