use of com.tngtech.archunit.core.importer.ClassFileImporter 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.importer.ClassFileImporter 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);
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project moduliths by moduliths.
the class ModuleDetectionStrategyUnitTest method detectsJMoleculesAnnotatedModule.
// #188
@Test
void detectsJMoleculesAnnotatedModule() {
JavaClasses classes = //
new ClassFileImporter().withImportOption(//
new ImportOption.OnlyIncludeTests()).importPackages("jmolecules");
JavaPackage javaPackage = JavaPackage.of(Classes.of(classes), "jmolecules");
assertThat(ModuleDetectionStrategy.explictlyAnnotated().getModuleBasePackages(javaPackage)).containsExactly(javaPackage);
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project arch-unit-build-plugin-core by societe-generale.
the class NoJavaUtilDateRuleTestTest method assertNoExceptionIsThrownFor.
private void assertNoExceptionIsThrownFor(Class clazz) {
JavaClasses classToTest = new ClassFileImporter().importClasses(clazz);
assertThatCode(() -> classes().should(NoJavaUtilDateRuleTest.notUseJavaUtilDate()).check(classToTest)).doesNotThrowAnyException();
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project good-food by silas-riacourt.
the class ArchTest method servicesAndRepositoriesShouldNotDependOnWebLayer.
@Test
void servicesAndRepositoriesShouldNotDependOnWebLayer() {
JavaClasses importedClasses = new ClassFileImporter().withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS).importPackages("fr.cesi.cube");
noClasses().that().resideInAnyPackage("fr.cesi.cube.service..").or().resideInAnyPackage("fr.cesi.cube.repository..").should().dependOnClassesThat().resideInAnyPackage("..fr.cesi.cube.web..").because("Services and repositories should not depend on web layer").check(importedClasses);
}
Aggregations