Interface GivenModules<DESCRIPTOR extends ArchModule.Descriptor>
- All Superinterfaces:
GivenObjects<ArchModule<DESCRIPTOR>>
- All Known Subinterfaces:
GivenModulesByAnnotation<ANNOTATION>
- All Known Implementing Classes:
ModuleRuleDefinition.PackagesDefinition
,ModuleRuleDefinition.RootClassesDefinition
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public interface GivenModules<DESCRIPTOR extends ArchModule.Descriptor>
extends GivenObjects<ArchModule<DESCRIPTOR>>
-
Method Summary
Modifier and TypeMethodDescriptionAllows to adjust the description of the "given modules" part.should()
Allows to specify assertions for the set ofArchModule
s under consideration.that
(DescribedPredicate<? super ArchModule<DESCRIPTOR>> predicate) Allows to restrict the set of objects under consideration.Methods inherited from interface com.tngtech.archunit.lang.syntax.elements.GivenObjects
should
-
Method Details
-
that
GivenModulesConjunction<DESCRIPTOR> that(DescribedPredicate<? super ArchModule<DESCRIPTOR>> predicate) Description copied from interface:GivenObjects
Allows to restrict the set of objects under consideration. E.g.
all(customObjects)
.that(predicate)
predicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
that
in interfaceGivenObjects<DESCRIPTOR extends ArchModule.Descriptor>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
should
Allows to specify assertions for the set ofArchModule
s under consideration. E.g.
modules()
.should()
.respectTheirAllowedDependencies(..)
UseGivenObjects.should(ArchCondition)
to freely customize the condition against which theArchModule
s should be checked.- Returns:
- A syntax element, which can be used to create rules for the
ArchModule
s under consideration
-
as
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) GivenModules<DESCRIPTOR> as(String description, Object... args) Allows to adjust the description of the "given modules" part. E.g.
would yield a rule text "App Modules should...".modules().definedByAnnotation(AppModule.class).as("App Modules").should()...
-