use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method classesShouldNotUseJunit5Assertions.
@Test
void classesShouldNotUseJunit5Assertions() {
ArchRule rule = noClasses().that().haveSimpleNameNotEndingWith("ArchitectureTest").should().dependOnClassesThat().haveFullyQualifiedName(org.junit.jupiter.api.Assertions.class.getName()).because("we consistently want to use assertj in our tests");
rule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method exceptionsThatShouldNotHaveToStringMethod.
@Test
void exceptionsThatShouldNotHaveToStringMethod() {
ArchRule myRule = classes().that().areAssignableTo(TaskanaException.class).or().areAssignableTo(TaskanaRuntimeException.class).and().doNotBelongToAnyOf(TaskanaRuntimeException.class, TaskanaException.class).should(notImplementToString());
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method taskanaIntegrationTestsShouldOnlyHavePackagePrivateFields.
@Test
void taskanaIntegrationTestsShouldOnlyHavePackagePrivateFields() {
ArchRule rule = classes().that().areAnnotatedWith(TaskanaIntegrationTest.class).or(areNestedTaskanaIntegrationTestClasses()).should(onlyHaveFieldsWithNoModifierAndPrivateConstants());
rule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method nestedTaskanaIntegrationTestsShouldBeAnnotatedWithTestInstance.
@Test
void nestedTaskanaIntegrationTestsShouldBeAnnotatedWithTestInstance() {
ArchRule rule = classes().that(areNestedTaskanaIntegrationTestClasses()).should(beAnnotatedWithTestInstancePerClass());
rule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project waltz by khartec.
the class EndpointArchitectureComplianceTest method endpointsNeedServiceAnnotation.
@Test
public void endpointsNeedServiceAnnotation() {
ArchRule rule = classes().that().areNotInterfaces().and().doNotHaveSimpleName("StaticResourcesEndpoint").and().haveNameMatching(".*Endpoint").should().beAnnotatedWith(Service.class);
rule.check(waltzOnlyClasses);
}
Aggregations