ArchUnit v0.9.0 Release Notes

Release Date: 2018-08-19 // over 5 years ago
  • Important

    ๐Ÿ‘ The Maven coordinates for com.tngtech.archunit:archunit-junit have changed, since there is now support for JUnit 4 and JUnit 5. The new coordinates for the equivalent artifact are now

    com.tngtech.archunit:archunit-junit4:0.9.0
    

    โœจ Enhancements

    Core

    ๐Ÿ‘€ archunit-ignore-patterns.txt can now contain comments (see #88; many thanks to @bedla)

    a JavaClass' directDependenciesFromSelf and directDependenciesToSelf now contain further dependencies. This affects many rules as well, like layeredArchitecture() which might now detect more violations than before. In particular dependencies now contain dependencies from

    • fields of a certain type
    • method/constructor parameters of a certain type
    • method return types

    ๐Ÿ‘€ (see #92 and #96; many thanks to @msherman32)

    ๐Ÿ‘€ the plugin mechanism activating Java >= 9 support now supports EA versions (see #93; many thanks to @jqno)

    Lang

    • ๐Ÿ‘€ the rule API now supports a concise way to assert properties of a single class (see #60; many thanks to @msherman32)
    • ๐Ÿ‘€ the rule API can now assert that classes haveOnlyFinalFields() (see #86; many thanks to @bgalek)
    • ๐Ÿ‘€ the rule API now allows to assert that there are at least / at most / exactly x classes matched by a rule (see #83; many thanks to @bedla)
    • rules can now be derived from PlantUML component diagrams (compare the User Guide; see #4; many thanks to @msherman32)
    • ๐Ÿ‘€ the rule API now allows to check more general for dependencies instead of just accesses (like interfaces, field types, method parameters, ...) (see #69)
    • ๐Ÿ‘€ the rule API now includes several methods to restrict what classes should "only" do, i.e. classes().should().onlyDependOnClassesThat()... or onlyCallMethodsThat(..), etc. (see #84)

    JUnit

    • ArchUnit now offers extended JUnit 5 support (compare the User Guide; see #34)

    Kotlin

    • rule suits with JUnit 4 / JUnit 5 can now be written in a concise way and source locations are reported correctly (compare the User Guide; see #77)