use of com.tngtech.archunit.junit.ArchTest in project jmolecules-integrations by xmolecules.
the class JMoleculesLayeredRulesTest method ensureLayering.
@ArchTest
void ensureLayering(JavaClasses types) {
EvaluationResult result = JMoleculesArchitectureRules.ensureLayering().evaluate(types);
//
assertThat(result.getFailureReport().getDetails()).satisfiesExactlyInAnyOrder(//
violation(AppType.class, UiType.class), //
violation(AppType.class, UiByAnnotation.class), //
violation(DomainType.class, AppType.class), //
violation(DomainType.class, AppByAnnotation.class), //
violation(DomainType.class, UiType.class), //
violation(DomainType.class, UiByAnnotation.class), //
violation(InfraType.class, DomainType.class), //
violation(InfraType.class, DomainByAnnotation.class), //
violation(InfraType.class, AppType.class), //
violation(InfraType.class, AppByAnnotation.class), //
violation(InfraType.class, UiType.class), //
violation(InfraType.class, UiByAnnotation.class));
}
use of com.tngtech.archunit.junit.ArchTest in project jmolecules-integrations by xmolecules.
the class JMoleculesOnionClassicalArchitectureRulesTest method ensureOnionClasical.
@ArchTest
void ensureOnionClasical(JavaClasses types) {
EvaluationResult result = JMoleculesArchitectureRules.ensureOnionClassical().evaluate(types);
//
assertThat(result.getFailureReport().getDetails()).satisfiesExactlyInAnyOrder(//
violation(AppType.class, InfraType.class), //
violation(AppType.class, InfraByAnnotation.class), //
violation(DomainServiceType.class, AppType.class), //
violation(DomainServiceType.class, AppServiceByAnnotation.class), //
violation(DomainServiceType.class, InfraType.class), //
violation(DomainServiceType.class, InfraByAnnotation.class), //
violation(DomainModelType.class, AppType.class), //
violation(DomainModelType.class, AppServiceByAnnotation.class), //
violation(DomainModelType.class, InfraType.class), //
violation(DomainModelType.class, InfraByAnnotation.class), //
violation(DomainModelType.class, DomainServiceType.class), //
violation(DomainModelType.class, DomainServiceByAnnotation.class));
}
use of com.tngtech.archunit.junit.ArchTest 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);
}
use of com.tngtech.archunit.junit.ArchTest in project zeebe by camunda-cloud.
the class ImmutableProtocolTest method shouldNotAnnotateExcludedClasses.
@ArchTest
void shouldNotAnnotateExcludedClasses(final JavaClasses importedClasses) {
// given
final ArchRule rule = ArchRuleDefinition.classes().that(getExcludedClasses()).should().notBeAnnotatedWith(ImmutableProtocol.class).orShould().notBeAnnotatedWith(Value.Immutable.class);
// then
rule.check(importedClasses);
}
Aggregations