File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/com/devonfw/sample/archunit Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .devonfw .sample .archunit ;
2+
3+ import com .tngtech .archunit .core .importer .ImportOption ;
4+
5+ import com .tngtech .archunit .junit .AnalyzeClasses ;
6+ import com .tngtech .archunit .junit .ArchTest ;
7+ import com .tngtech .archunit .lang .ArchRule ;
8+ import static com .tngtech .archunit .lang .syntax .ArchRuleDefinition .noClasses ;
9+
10+ @ AnalyzeClasses (packages = "com.devonfw.sample.archunit" , importOptions = ImportOption .DoNotIncludeTests .class )
11+ public class ThirdPartyRulesTest {
12+
13+ @ ArchTest
14+ private static ArchRule check_object_dependency = noClasses ()
15+ .should ().dependOnClassesThat ()
16+ .haveFullyQualifiedName ("com.google.common.base.Objects" )
17+ .because ("Use Java standards instead (java.util.Objects)." );
18+
19+ @ ArchTest
20+ private static ArchRule check_converter_dependency = noClasses ()
21+ .should ().dependOnClassesThat ()
22+ .haveFullyQualifiedName ("javax.persistence.Convert" )
23+ .because ("Use the javax.persistence.Converter annotation on a custom converter"
24+ + " which implements the javax.persistence.AttributeConverter instead of the 'javax.persistance.Convert' annotation" );
25+
26+ @ ArchTest
27+ private static ArchRule check_mysema_dependency = noClasses ()
28+ .should ().dependOnClassesThat ().resideInAPackage ("com.mysema.query.." )
29+ .because ("Use official QueryDSL (com.querydsl.* e.g. from com.querydsl:querydsl-jpa)." );
30+
31+ }
You can’t perform that action at this time.
0 commit comments