Skip to content

Commit

Permalink
Enforce no cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
pivovarit committed Jan 15, 2025
1 parent 9f072c1 commit 89289ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/java/com/pivovarit/collectors/ArchitectureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 89289ed

Please sign in to comment.