Unit Test Your Java Architecture With ArchUnit
summary
Uses ArchUnit plus JUnit 5 to turn architecture rules into executable unit tests against Java bytecode, demonstrated on Spring PetClinic: naming conventions, package/module dependency checks, layered-architecture enforcement and cycle detection all fail fast with precise messages and IntelliJ links. Shows jMolecules to declare layers in production code and uses a freeze file that records existing violations so legacy projects can incrementally clean up without breaking CI. Tests run once-per-analysis so subsequent checks are much faster.
AI-written summary · about
chapters (10)
- 0:00ArchUnit and architecture challenges
- 5:29What is ArchUnit
- 9:10Setup with Spring demo
- 12:28Enforcing naming conventions
- 15:24Module dependencies and circular violations
- 20:48Layered architecture checks
- 24:01ArchUnit with JMolecules
- 28:02Legacy projects with freezing rules
- 33:57Automated architecture testing in CI
- 35:44Q&A
related talks
45mUnit Test Your Java Architecture With ArchUnit
24mUnit Testing Your Architecture
52mArchUnit - Unit Testing Architecture and Design
49mArchUnit: Guarding the Logic of Your Application
22mArchitecture & ArchUnit
42mArchitecture testing with ArchUnit: Implementation for DDD
41mSoftware Architecture — Yes, on Tests
49mJava's Hidden Gems: Tools and Libraries
