Skip to content

Commit 1bc6e34

Browse files
test(architecture): fix test on clean architecture layers
1 parent ad297dd commit 1bc6e34

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/test/kotlin/architecture/CleanArchitectureTest.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ class CleanArchitectureTest : FunSpec({
2020
.noClasses().that().resideInAPackage("..entities..")
2121
.should().dependOnClassesThat().resideInAPackage("..application..")
2222
.andShould().dependOnClassesThat().resideInAPackage("..infrastructure..")
23-
.check(ClassFileImporter().importPackages("..entities.."))
23+
.check(ClassFileImporter().importPackages("entities.."))
2424
}
2525

2626
test("Application layer should not depend on Infrastructure layer") {
2727
ArchRuleDefinition
2828
.noClasses().that().resideInAPackage("..application..")
2929
.should().dependOnClassesThat().resideInAPackage("..infrastructure..")
30-
.check(ClassFileImporter().importPackages("..application.."))
30+
.check(ClassFileImporter().importPackages("application.."))
3131
}
3232

3333
test("The layer of architecture should respect clean architecture principles") {
3434
layeredArchitecture()
3535
.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.."))
4143
}
4244
})

0 commit comments

Comments
 (0)