ArchUnit 0.13.0
codecholeric
released this
10 Jan 22:23
·
2 commits
to release-0.13.0
since this release
Breaking Changes
- While technically a very slim chance of really "breaking" anything, the log level of some details during the class file import has been reduced from
DEBUG
toTRACE
(field, method, access and call details, ...) (see #291)
Enhancements
Core
- Annotations and annotation parameters are now detected as dependencies. This could cause new findings when using the rules or library API. In particular
JavaClass.getDirectDependencies{From/To}Self()
will now also returnDependencies
that originate from@FormerlyNotDetected
or@Foo(someEnum = SomeEnumFormerlyNotDetected.FOO)
or@Foo(bar = @Bar(type = SomeTypeFormerlyNotDetected.class))
(see #136; thanks a lot to @kosani)
Lang
- Some rule API method parameter types were invariant instead of contravariant (effectively preventing a predicate for a super type to be passed). These methods should now be fixed (see #262)
- The rules API now offers more methods to filter and assert the type of class declaration ("top level class", "nested class", "member class", "inner class", "anonymous class" and "local class") (see #207; many thanks to @rweisleder)
Library
FreezingArchRule
by default now not only ignores line numbers, but also numbers after$
which effectively makes theViolationStore
resilient against changes in compiled lambda and anonymous class names (see #248; thanks a lot to @hankem)LayeredArchitecture
andOnionArchitecture
now allow to configureoptionalLayers()
. In version0.12.0
the behavior was made more strict, forbidding empty layers / parts ofLayeredArchitecture
andOnionArchitecture
to prevent misconfiguration. This in turn unfortunately broke some valid use cases where empty / optional layers were in fact okay. In version0.13.0
this is now completely configurable. By default it will still fail to prevent misconfiguration, but a switch ofwithOptionalLayers(true)
oroptionalLayer("Some Layer")
will allow empty layers (and in turn empty parts ofOnionArchitecture
) (see #267 and #271; many thanks to @hankem)
JUnit
- there is now a ArchUnit JUnit 5 aggregator POM, i.e. instead of two dependencies
archunit-junit5-api
andarchunit-junit5-engine
, it is now also possible to simply add a single dependencyarchunit-junit5
with scopetest
/testCompile
. Compare the user guide (see #272; thanks a lot to @eddumelendez) - Dependency upgrades (see #292)
junit-platform-*
from1.5.1
to1.5.2
junit4
from4.12
to4.13
(in case of problems witharchunit-junit4
it should be possible to exclude the transitive dependency to JUnit4.13
and replace it by a custom4.12
one)
Further Acknowledgement
- Many thanks to @Bananeweizen for fixing spelling and grammar mistakes in Javadoc / methods