File tree Expand file tree Collapse file tree
archunit-example/example-plain/src/test/java/com/tngtech/archunit/exampletest
main/java/com/tngtech/archunit/library/dependencies
test/java/com/tngtech/archunit/library/dependencies Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import com .tngtech .archunit .core .importer .ClassFileImporter ;
66import com .tngtech .archunit .example .cycles .complexcycles .slice1 .SliceOneCallingConstructorInSliceTwoAndMethodInSliceThree ;
77import com .tngtech .archunit .example .cycles .complexcycles .slice3 .ClassCallingConstructorInSliceFive ;
8+ import com .tngtech .archunit .lang .Priority ;
89import com .tngtech .archunit .library .dependencies .SliceAssignment ;
910import com .tngtech .archunit .library .dependencies .SliceIdentifier ;
1011import org .junit .Test ;
@@ -80,7 +81,7 @@ public void no_cycles_in_complex_scenario_with_custom_ignore() {
8081
8182 @ Test
8283 public void no_cycles_in_freely_customized_slices () {
83- slices ().assignedFrom (inComplexSliceOneOrTwo ())
84+ slices ().assignedFrom (inComplexSliceOneOrTwo (), Priority . HIGH )
8485 .namingSlices ("$1[$2]" )
8586 .should ().beFreeOfCycles ()
8687 .check (classes );
Original file line number Diff line number Diff line change @@ -64,15 +64,31 @@ private Creator() {
6464 */
6565 @ PublicAPI (usage = ACCESS )
6666 public GivenSlices matching (String packageIdentifier ) {
67- return new GivenSlicesInternal (Priority .MEDIUM , Slices .matching (packageIdentifier ));
67+ return matching (packageIdentifier , Priority .MEDIUM );
68+ }
69+
70+ /**
71+ * @see Slices#matching(String)
72+ */
73+ @ PublicAPI (usage = ACCESS )
74+ public GivenSlices matching (String packageIdentifier , Priority priority ) {
75+ return new GivenSlicesInternal (priority , Slices .matching (packageIdentifier ));
6876 }
6977
7078 /**
7179 * @see Slices#assignedFrom(SliceAssignment)
7280 */
7381 @ PublicAPI (usage = ACCESS )
7482 public GivenSlices assignedFrom (SliceAssignment assignment ) {
75- return new GivenSlicesInternal (Priority .MEDIUM , Slices .assignedFrom (assignment ));
83+ return assignedFrom (assignment , Priority .MEDIUM );
84+ }
85+
86+ /**
87+ * @see Slices#assignedFrom(SliceAssignment)
88+ */
89+ @ PublicAPI (usage = ACCESS )
90+ public GivenSlices assignedFrom (SliceAssignment assignment , Priority priority ) {
91+ return new GivenSlicesInternal (priority , Slices .assignedFrom (assignment ));
7692 }
7793 }
7894}
Original file line number Diff line number Diff line change 99import com .tngtech .archunit .lang .ArchCondition ;
1010import com .tngtech .archunit .lang .ConditionEvents ;
1111import com .tngtech .archunit .lang .EvaluationResult ;
12+ import com .tngtech .archunit .lang .Priority ;
1213import com .tngtech .archunit .lang .syntax .elements .GivenConjunction ;
1314import com .tngtech .archunit .library .LayeredArchitectureTest ;
1415import com .tngtech .archunit .library .dependencies .syntax .GivenSlices ;
@@ -72,7 +73,7 @@ public void restricting_slices_that_should_not_depend_on_each_other() {
7273 }
7374
7475 private GivenSlices testSlices () {
75- return slices ().matching (TEST_CLASSES_PACKAGE + ".(*).." );
76+ return slices ().matching (TEST_CLASSES_PACKAGE + ".(*).." , Priority . HIGH );
7677 }
7778
7879 private DescribedPredicate <Slice > descriptionMatching (String regex ) {
You can’t perform that action at this time.
0 commit comments