~/talk

Unit Test Your Java Architecture With ArchUnit

Talkat JCON EUROPE 2025 · 2025-05-12..05-15· [java, testing]
slides:none on file

ArchUnit is used to analyzes Java bytecode and enforce concrete rules: controllers annotated with @Controller must have names ending with Controller, owner and vet packages must not depend on each other, and module/package cycles are detectable. It integrates with JUnit 4/5, can be packaged as a shared rules library, and extends via custom conditions (example: methods with @PostMapping must call an SLF4J logger). For legacy bases it supports a freeze current violations file (demo shows five immediate violations but warns real projects can have hundreds), and Spring Modulith and jMolecules interoperate.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 9:21First ArchUnit rule demo
  3. 15:00Module dependency rules
  4. 17:12Standard rule sets and Spring
  5. 21:48Reusable rules across projects
  6. 25:03Detecting module cycles
  7. 27:13Spring Modulith comparison
  8. 28:37ArchUnit and bytecode analysis
  9. 29:20Legacy code integration
  10. 33:57Freezing violations for gradual fixes
  11. 37:16Adding new violations after freezing
  12. 38:00Detecting logging requirements
  13. 39:06Hexagonal architecture with JMolecules
  14. 41:57Architecture as code summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.