use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class SpringArchitectureTest method should_AnnotateAllFieldsWithJsonProperty_When_ImplementingQueryParameter.
@Test
void should_AnnotateAllFieldsWithJsonProperty_When_ImplementingQueryParameter() {
ArchRule myRule = classes().that().implement(QueryParameter.class).should(shouldOnlyHaveAnnotatedFields());
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method onlyExceptionsShouldResideInExceptionPackage.
@Test
void onlyExceptionsShouldResideInExceptionPackage() {
ArchRule myRule = classes().that().resideInAPackage("..exceptions").and().doNotBelongToAnyOf(ErrorCode.class).should().beAssignableTo(Predicates.assignableTo(TaskanaException.class).or(Predicates.assignableTo(TaskanaRuntimeException.class))).andShould().bePublic().andShould().haveSimpleNameEndingWith("Exception");
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method exceptionsShouldBePlacedInExceptionPackage.
@Test
void exceptionsShouldBePlacedInExceptionPackage() {
ArchRule myRule = classes().that().haveSimpleNameEndingWith("Exception").should().resideInAPackage("..exceptions..");
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method mapperClassesShouldNotUseCurrentTimestampSqlFunction.
@Test
void mapperClassesShouldNotUseCurrentTimestampSqlFunction() {
ArchRule rule = classes().that().haveSimpleNameEndingWith("Mapper").should(notUseCurrentTimestampSqlFunction());
rule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method apiClassesShouldNotDependOnInternalClasses.
@Test
void apiClassesShouldNotDependOnInternalClasses() {
ArchRule myRule = classes().that().resideInAPackage("..api..").should().onlyDependOnClassesThat(Predicates.resideOutsideOfPackage("..pro.taskana..internal..").or(Predicates.assignableTo(LoggingAspect.class).or(Predicates.assignableTo(MapCreator.class))));
myRule.check(importedClasses);
}
Aggregations