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 ofArchModules 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:GivenObjectsAllows to restrict the set of objects under consideration. E.g.
Note that many predefinedall(customObjects).that(predicate)predicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaClasscan be found withinJavaClass.Predicatesor one of the respective ancestors likeHasName.Predicates.- Specified by:
thatin 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 ofArchModules under consideration. E.g.
modules().should().respectTheirAllowedDependencies(..)
UseGivenObjects.should(ArchCondition)to freely customize the condition against which theArchModules should be checked.- Returns:
- A syntax element, which can be used to create rules for the
ArchModules 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()...
-