use of com.tngtech.archunit.core.domain.JavaClasses in project AngularPortfolioMgr by Angular2Guy.
the class MyArchitectureTests method ruleGeneralCodingRules.
@Test
public void ruleGeneralCodingRules() {
ArchRule archRule = CompositeArchRule.of(GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS).and(NO_CLASSES_SHOULD_USE_FIELD_INJECTION).because("Good practice");
JavaClasses classesToCheck = this.importedClasses.that(JavaClass.Predicates.resideOutsideOfPackages("..adapter.clients.test.."));
archRule.check(classesToCheck);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project AngularPortfolioMgr by Angular2Guy.
the class MyArchitectureTests method ruleGeneralCodingRulesLoggers.
@Test
public void ruleGeneralCodingRulesLoggers() {
JavaClasses classesToCheck = this.importedClasses.that(JavaClass.Predicates.resideOutsideOfPackages("..domain.utils.."));
ArchRuleDefinition.fields().that().haveRawType(Logger.class).should().bePrivate().andShould().beStatic().andShould().beFinal().because("we agreed on this convention").check(classesToCheck);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project AngularAndSpring by Angular2Guy.
the class MyArchitectureTests method ruleGeneralCodingRules.
@Test
public void ruleGeneralCodingRules() {
ArchRule archRule = CompositeArchRule.of(GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS).and(NO_CLASSES_SHOULD_USE_FIELD_INJECTION).because("Good practice");
JavaClasses classesToCheck = this.importedClasses.that(JavaClass.Predicates.resideOutsideOfPackages("..adapter.clients.test.."));
archRule.check(classesToCheck);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project corrigeExamBack by barais.
the class ArchTest method servicesAndRepositoriesShouldNotDependOnWebLayer.
@Test
void servicesAndRepositoriesShouldNotDependOnWebLayer() {
JavaClasses importedClasses = new ClassFileImporter().withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS).importPackages("com.mycompany.myapp");
noClasses().that().resideInAnyPackage("..service..").or().resideInAnyPackage("..repository..").should().dependOnClassesThat().resideInAnyPackage("..com.mycompany.myapp.web..").because("Services and repositories should not depend on web layer").check(importedClasses);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project SoftwareEngineeringProject by AlioLeuchtmannUni.
the class ArchTest method servicesAndRepositoriesShouldNotDependOnWebLayer.
@Test
void servicesAndRepositoriesShouldNotDependOnWebLayer() {
JavaClasses importedClasses = new ClassFileImporter().withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS).importPackages("praktikumsverwaltung");
noClasses().that().resideInAnyPackage("praktikumsverwaltung.service..").or().resideInAnyPackage("praktikumsverwaltung.repository..").should().dependOnClassesThat().resideInAnyPackage("..praktikumsverwaltung.web..").because("Services and repositories should not depend on web layer").check(importedClasses);
}
Aggregations