File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/test/java/com/devonfw/sample/archunit Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .devonfw .sample .archunit ;
2+
3+ import com .tngtech .archunit .junit .AnalyzeClasses ;
4+ import com .tngtech .archunit .junit .ArchTest ;
5+ import com .tngtech .archunit .lang .ArchRule ;
6+
7+ import static com .tngtech .archunit .library .dependencies .SlicesRuleDefinition .slices ;
8+
9+ import com .tngtech .archunit .core .importer .ImportOption ;
10+
11+ @ AnalyzeClasses (packages = "com.devonfw.sample.archunit" , importOptions = ImportOption .DoNotIncludeTests .class )
12+ public class AvoidCyclicDependenciesTest {
13+ @ ArchTest
14+ static final ArchRule no_cyclic_dependencies_are_allowed =
15+ slices ()
16+ .matching ("..(*).(common|service|logic|dataaccess|batch|client).." )
17+ .namingSlices ("$1 slice" )
18+ .should ()
19+ .beFreeOfCycles ()
20+ //.ignoreDependency(alwaysTrue(), simpleNameEndingWith("Repository"))
21+ .because ("Cyclic dependencies should be prevented." );
22+
23+ }
You can’t perform that action at this time.
0 commit comments