@@ -20,23 +20,25 @@ class CleanArchitectureTest : FunSpec({
20
20
.noClasses().that().resideInAPackage("..entities..")
21
21
.should().dependOnClassesThat().resideInAPackage("..application..")
22
22
.andShould().dependOnClassesThat().resideInAPackage("..infrastructure..")
23
- .check(ClassFileImporter ().importPackages(".. entities.."))
23
+ .check(ClassFileImporter ().importPackages("entities.."))
24
24
}
25
25
26
26
test("Application layer should not depend on Infrastructure layer") {
27
27
ArchRuleDefinition
28
28
.noClasses().that().resideInAPackage("..application..")
29
29
.should().dependOnClassesThat().resideInAPackage("..infrastructure..")
30
- .check(ClassFileImporter ().importPackages(".. application.."))
30
+ .check(ClassFileImporter ().importPackages("application.."))
31
31
}
32
32
33
33
test("The layer of architecture should respect clean architecture principles") {
34
34
layeredArchitecture()
35
35
.consideringAllDependencies()
36
- .layer("Entity ").definedBy("..entities..")
37
- .layer("Application ").definedBy("..application..")
38
- .layer("Infrastructure ").definedBy("..infrastructure..")
39
- .whereLayer("Application ").mayOnlyBeAccessedByLayers("Infrastructure ")
40
- .whereLayer("Entity ").mayNotAccessAnyLayer()
36
+ .layer("entity").definedBy("entities..")
37
+ .layer("application").definedBy("application..")
38
+ .layer("infrastructure").definedBy("infrastructure..")
39
+ .whereLayer("entity").mayOnlyBeAccessedByLayers("application", "infrastructure")
40
+ .whereLayer("application").mayOnlyBeAccessedByLayers("infrastructure")
41
+ .whereLayer("infrastructure").mayNotBeAccessedByAnyLayer()
42
+ .check(ClassFileImporter ().importPackages("entities..", "application..", "infrastructure.."))
41
43
}
42
44
})
0 commit comments