Registry / testing / archunit-junit5

archunit-junit5

JSON →
library1.4.1javamavenunverified

A Java architecture test library that integrates with JUnit 5 to specify and assert architecture rules in plain Java.

<dependency> <groupId>com.tngtech.archunit</groupId> <artifactId>archunit-junit5</artifactId> <version>1.4.1</version> </dependency>
INSTALL
IMPORT
SIG · ARCHUNIT-JUNIT5
A
archunit-junit5
testingjavav1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AnalyzeClasses
com.tngtech.archunit.junit.AnalyzeClasses

Defines an architecture test that checks all classes in the service package are annotated with @Service.

import com.tngtech.archunit.junit.AnalyzeClasses; import com.tngtech.archunit.junit.ArchTest; import com.tngtech.archunit.lang.ArchRule; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; @AnalyzeClasses(packages = "com.example") public class ArchitectureTest { @ArchTest static final ArchRule services_should_be_annotated = classes() .that().resideInAPackage("..service..") .should().beAnnotatedWith(Service.class); }
Debug
Known issues
breakingArchUnit JUnit5 requires JUnit 5.4 or later.
fix
Ensure your project uses JUnit 5.4+ and the archunit-junit5 dependency is on the test classpath.
affects: <1.0.0
Upgrade
Version history
1.4.1latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
archunit-junit5 — mvn dependency:get archunit-junit5 · libregistry