diff --git a/src/test/java/com/pivovarit/collectors/ArchitectureTest.java b/src/test/java/com/pivovarit/collectors/ArchitectureTest.java index 3d29155a..c62db185 100644 --- a/src/test/java/com/pivovarit/collectors/ArchitectureTest.java +++ b/src/test/java/com/pivovarit/collectors/ArchitectureTest.java @@ -7,10 +7,18 @@ import static com.tngtech.archunit.core.domain.JavaModifier.FINAL; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; +import static com.tngtech.archunit.library.dependencies.SlicesRuleDefinition.slices; @AnalyzeClasses(packages = "com.pivovarit", importOptions = ImportOption.DoNotIncludeTests.class) class ArchitectureTest { + @ArchTest + static final ArchRule shouldBeFreeOfCycles = slices() + .matching("com.pivovarit.(*)..") + .should().beFreeOfCycles() + .as("the library should be free of cycles") + .because("cycles are bad"); + @ArchTest static final ArchRule shouldHaveSingleFacade = classes() .that().arePublic()