com.tngtech.archunit.junit.ArchTest Java Examples

The following examples show how to use com.tngtech.archunit.junit.ArchTest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AggregateArchitectureTest.java    From ddd-with-spring with Apache License 2.0 5 votes vote down vote up
@ArchTest
public static void aggregateAnnotationRules(JavaClasses importedClasses) {
    ArchRule namingToAnnotation = classes().that().haveSimpleNameEndingWith("Aggregate").should().beAnnotatedWith(Aggregate.class);
    namingToAnnotation.check(importedClasses);

    ArchRule annotationToNaming = classes().that().areAnnotatedWith(Aggregate.class).should().haveSimpleNameEndingWith("Aggregate");
    annotationToNaming.check(importedClasses);
}
 
Example #2
Source File: ComplexMetaTags.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@MethodTag
@ArchTest
static void method_rule(JavaClasses classes) {
}
 
Example #3
Source File: CodingRulesTest.java    From ArchUnit-Examples with Apache License 2.0 4 votes vote down vote up
@ArchTest
private void no_access_to_standard_streams_as_method(JavaClasses classes) {
    noClasses().should(ACCESS_STANDARD_STREAMS).check(classes);
}
 
Example #4
Source File: CodingRulesTest.java    From ArchUnit-Examples with Apache License 2.0 4 votes vote down vote up
@ArchTest
private void no_access_to_standard_streams_as_method(JavaClasses classes) {
    noClasses().should(ACCESS_STANDARD_STREAMS).check(classes);
}
 
Example #5
Source File: ClassWithPrivateTests.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
private void privateRuleMethod(JavaClasses classes) {
    RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes);
}
 
Example #6
Source File: TestClassWithTags.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void method_in_class_with_tags(JavaClasses classes) {
}
 
Example #7
Source File: TestMethodWithMetaTag.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@MetaTag
@ArchTest
static void method_with_meta_tag(JavaClasses classes) {
}
 
Example #8
Source File: WrongRuleMethodNotStatic.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
void notStatic(JavaClasses classes) {
}
 
Example #9
Source File: WrongRuleMethodWrongParameters.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void wrongParameters() {
}
 
Example #10
Source File: TestClassWithMetaTag.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void method_in_class_with_meta_tag(JavaClasses classes) {
}
 
Example #11
Source File: TestMethodWithMetaTags.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@MetaTags
@ArchTest
static void method_with_meta_tags(JavaClasses classes) {
}
 
Example #12
Source File: SimpleRules.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
public static void simple_rule_method_two(JavaClasses classes) {
    RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes);
}
 
Example #13
Source File: SimpleRules.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
public static void simple_rule_method_one(JavaClasses classes) {
    RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes);
}
 
Example #14
Source File: ComplexTags.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTag("method-tag")
@ArchTest
static void method_rule(JavaClasses classes) {
}
 
Example #15
Source File: TestMethodWithTags.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTag("method-tag-one")
@ArchTag("method-tag-two")
@ArchTest
static void method_with_tag(JavaClasses classes) {
}
 
Example #16
Source File: SimpleRuleMethod.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void simple_rule(JavaClasses classes) {
    RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes);
}
 
Example #17
Source File: MetaIgnoredClass.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void rule_two(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #18
Source File: MetaIgnoredMethod.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
@ArchIgnoreMetaAnnotation
static void ignored_rule(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #19
Source File: MetaIgnoredMethod.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void unignored_rule(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #20
Source File: IgnoredClass.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void rule_two(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #21
Source File: IgnoredMethod.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
@ArchIgnore
static void ignored_rule(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #22
Source File: IgnoredMethod.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
static void unignored_rule(JavaClasses classes) {
    RuleThatFails.on(CLASS_VIOLATING_RULES).check(classes);
}
 
Example #23
Source File: CodingRulesTest.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
private void no_access_to_standard_streams_as_method(JavaClasses classes) {
    noClasses().should(ACCESS_STANDARD_STREAMS).check(classes);
}
 
Example #24
Source File: CodingRulesTest.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
@ArchTest
private void no_access_to_standard_streams_as_method(JavaClasses classes) {
    noClasses().should(ACCESS_STANDARD_STREAMS).check(classes);
}