use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method exceptionsThatShouldHaveToStringMethod.
@Test
void exceptionsThatShouldHaveToStringMethod() {
ArchRule myRule = classes().that().areAssignableFrom(TaskanaRuntimeException.class).or().areAssignableFrom(TaskanaException.class).should(implementToString());
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method everySubpackageShouldBeTestsForCyclicDependencies.
@Test
void everySubpackageShouldBeTestsForCyclicDependencies() {
List<Pattern> excludePackages = Stream.of(// from TaskanaEngineConfiguration
"pro.taskana", // all our acceptance tests
"acceptance.*", // our test API
"testapi.*").map(Pattern::compile).collect(Collectors.toList());
ArchRule myRule = classes().should(beDefinedInTaskanaSubPackages(excludePackages));
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method testMethodNamesShouldMatchAccordingToOurGuidelines.
@Test
@Disabled("until we have renamed all tests")
void testMethodNamesShouldMatchAccordingToOurGuidelines() {
ArchRule myRule = methods().that().areAnnotatedWith(Test.class).or().areAnnotatedWith(TestFactory.class).and().areNotDeclaredIn(ArchitectureTest.class).should().bePackagePrivate().andShould().haveNameMatching("^should_[A-Z][^_]+_(For|When)_[A-Z][^_]+$");
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project taskana by Taskana.
the class ArchitectureTest method utilityClassesShouldNotBeInitializable.
@Test
void utilityClassesShouldNotBeInitializable() {
ArchRule myRule = classes().that().resideInAPackage("..util..").and().areNotNestedClasses().should().haveOnlyPrivateConstructors();
myRule.check(importedClasses);
}
use of com.tngtech.archunit.lang.ArchRule in project BitBook by C-Otto.
the class ArchUnitIT method services_must_not_access_spring_data_repositories_directly.
@Test
void services_must_not_access_spring_data_repositories_directly() {
ArchRule rule = ArchRuleDefinition.noClasses().that().areAssignableTo(Repository.class).should().dependOnClassesThat().haveSimpleNameEndingWith("Service");
rule.check(importedClasses);
}
Aggregations