use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.
the class EndpointArchitectureComplianceTest method extractorsImplementDataExtractor.
@Test
public void extractorsImplementDataExtractor() {
ArchRule rule = classes().that().haveNameMatching(".*Extractor").and().areNotInterfaces().should().implement(DataExtractor.class);
rule.check(waltzOnlyClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.
the class EndpointArchitectureComplianceTest method endpointsNeedMarkerInterface.
@Test
public void endpointsNeedMarkerInterface() {
ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Endpoint").should().implement(Endpoint.class);
rule.check(waltzOnlyClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.
the class ServicesArchitectureComplianceTest method servicesNeedServiceAnnotation.
@Test
public void servicesNeedServiceAnnotation() {
ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Service").should().beAnnotatedWith(Service.class);
rule.check(waltzOnlyClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.
the class ServicesArchitectureComplianceTest method methodsPrefixedFindShouldReturnCollections.
@Test
public void methodsPrefixedFindShouldReturnCollections() {
ArchRule rule = classes().that().areNotInterfaces().and().haveNameMatching(".*Service").should(haveFindMethodsThatReturnCollectionsOrMapsOrOptionals);
rule.check(waltzAndJavaUtilClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project zeebe by camunda-cloud.
the class ImmutableProtocolTest method shouldAnnotateImmutableProtocol.
@ArchTest
void shouldAnnotateImmutableProtocol(final JavaClasses importedClasses) {
// given
final ArchRule rule = ArchRuleDefinition.classes().that().areInterfaces().and().resideInAnyPackage("io.camunda.zeebe.protocol.record.value..").or(Predicates.equivalentTo(Record.class)).and(DescribedPredicate.not(getExcludedClasses())).should().beAnnotatedWith(Value.Immutable.class).andShould().beAnnotatedWith(ImmutableProtocol.class).andShould(new BuilderCondition());
// then
rule.check(importedClasses);
}
Aggregations