Search in sources :

Example 41 with ArchRule

use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.

the class DaoArchitectureComplianceTest method daosNeedRepositoryAnnotation.

@Test
public void daosNeedRepositoryAnnotation() {
    ArchRule rule = classes().that().areNotInterfaces().and().doNotHaveModifier(ABSTRACT).and().resideInAPackage("..finos..").and().haveNameMatching(".*Dao").should().beAnnotatedWith(Repository.class);
    rule.check(waltzAndJavaUtilClasses);
}
Also used : ArchRule(com.tngtech.archunit.lang.ArchRule) Test(org.junit.jupiter.api.Test)

Example 42 with ArchRule

use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.

the class DaoArchitectureComplianceTest method methodsPrefixedFindShouldReturnCollections.

@Test
public void methodsPrefixedFindShouldReturnCollections() {
    ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Dao").should(haveFindMethodsThatReturnCollectionsOrMapsOrOptionals);
    rule.check(waltzAndJavaUtilClasses);
}
Also used : ArchRule(com.tngtech.archunit.lang.ArchRule) Test(org.junit.jupiter.api.Test)

Example 43 with ArchRule

use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.

the class DaoArchitectureComplianceTest method daoMethodsShouldNotUseSelectFrom.

@Test
public void daoMethodsShouldNotUseSelectFrom() {
    ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Dao").should(notHaveDaoMethodsWhichCallSelectFrom);
    rule.check(waltzOnlyClasses);
}
Also used : ArchRule(com.tngtech.archunit.lang.ArchRule) Test(org.junit.jupiter.api.Test)

Example 44 with ArchRule

use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.

the class EndpointArchitectureComplianceTest method extractorsNeedServiceAnnotation.

@Test
public void extractorsNeedServiceAnnotation() {
    ArchRule rule = classes().that().areAssignableTo(DataExtractor.class).and().doNotHaveModifier(ABSTRACT).and().doNotHaveSimpleName("DataExtractor").should().haveNameMatching(".*Extractor").andShould().beAnnotatedWith(Service.class);
    rule.check(waltzOnlyClasses);
}
Also used : ArchRule(com.tngtech.archunit.lang.ArchRule) Test(org.junit.jupiter.api.Test)

Example 45 with ArchRule

use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.

the class ModelArchitectureComplianceTest method commandsNeedMarkerInterface.

@Test
public void commandsNeedMarkerInterface() {
    ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Command").should().implement(Command.class);
    rule.check(waltzOnlyClasses);
}
Also used : ArchRule(com.tngtech.archunit.lang.ArchRule) Test(org.junit.jupiter.api.Test)

Aggregations

ArchRule (com.tngtech.archunit.lang.ArchRule)141 Test (org.junit.jupiter.api.Test)90 Test (org.junit.Test)37 ArchTest (com.tngtech.archunit.junit.ArchTest)19 CompositeArchRule (com.tngtech.archunit.lang.CompositeArchRule)19 JavaClasses (com.tngtech.archunit.core.domain.JavaClasses)18 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)13 ClassFileImporter (com.tngtech.archunit.core.importer.ClassFileImporter)12 DynamicTest (org.junit.jupiter.api.DynamicTest)12 TaskanaIntegrationTest (testapi.TaskanaIntegrationTest)12 EvaluationResult (com.tngtech.archunit.lang.EvaluationResult)6 JavaClass (com.tngtech.archunit.core.domain.JavaClass)5 Immutable (org.eclipse.sirius.components.annotations.Immutable)5 ArchConfiguration (com.tngtech.archunit.ArchConfiguration)4 JavaField (com.tngtech.archunit.core.domain.JavaField)4 CanBeAnnotatedTest (com.tngtech.archunit.core.domain.properties.CanBeAnnotatedTest)4 ArchCondition (com.tngtech.archunit.lang.ArchCondition)3 ClassViolatingCodingRules (com.tngtech.archunit.example.layers.ClassViolatingCodingRules)2 ImmutableProtocol (io.camunda.zeebe.protocol.record.ImmutableProtocol)2 Record (io.camunda.zeebe.protocol.record.Record)2