mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 17:15:48 +00:00
Add ArchUnit tests for domain layer
This commit is contained in:
parent
98136d141d
commit
b5cccd109c
1 changed files with 22 additions and 0 deletions
|
@ -23,4 +23,26 @@ class LayerDependencyRulesTest {
|
|||
rule.check(importedClasses);
|
||||
}
|
||||
|
||||
@Test
|
||||
void domainLayerShouldNotDependOnApplicationLayer() {
|
||||
ArchRule rule = noClasses().that()
|
||||
.resideInAPackage("..domain..")
|
||||
.should()
|
||||
.dependOnClassesThat()
|
||||
.resideInAPackage("..application..");
|
||||
|
||||
rule.check(importedClasses);
|
||||
}
|
||||
|
||||
@Test
|
||||
void domainLayerShouldNotDependOnInfrastructureLayer() {
|
||||
ArchRule rule = noClasses().that()
|
||||
.resideInAPackage("..domain..")
|
||||
.should()
|
||||
.dependOnClassesThat()
|
||||
.resideInAPackage("..infrastructure..");
|
||||
|
||||
rule.check(importedClasses);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue