Releases: assertj/assertj
v3.27.7
π Security
Core
- Fix XXE vulnerability in
isXmlEqualToassertion (CVE-2026-24400)- See GHSA-rqfh-9r24-8c9r for details; many thanks to @wxt201 and @Song-Li for responsibly reporting it!
π« Deprecated
Core
- Deprecate
XmlStringPrettyFormatterwith no replacement
π Bug Fixes
Guava
- Navigation to
assertj-coreorguavatypes fromassertj-guavaJavadoc site has unnecessary header #3478
π¨ Dependency Upgrades
Core
- Upgrade to Byte Buddy 1.18.3
- Upgrade to JUnit BOM 5.14.1
Guava
- Upgrade to Guava 33.5.0-jre
v3.27.6
v3.27.5
v3.27.4
π« Deprecated
Core
- Deprecate
org.assertj.core.annotations.Betain favor oforg.assertj.core.annotation.Beta - Deprecate
org.assertj.core.util.CanIgnoreReturnValuein favor oforg.assertj.core.annotation.CanIgnoreReturnValue - Deprecate
org.assertj.core.util.CheckReturnValuein favor oforg.assertj.core.annotation.CheckReturnValue
π Bug Fixes
Core
- Fix thread-safety in
AbstractDateAssert#3874
β‘ Improvements
- Migrate to the Central Publisher Portal, enable snapshot publishing #3881
Core
- Annotate
failmethods with custom@Contract#3882
β€οΈ Contributors
Thanks to all the contributors who worked on this release:
v4.0.0-M1
π§© Binary Compatibility
This release is binary incompatible with the previous major version.
π₯ Breaking Changes
- Raise required Java version to 17 #3447
π« Deprecated
- Set
since = "3"andforRemoval = truefor all deprecations #3762
Core
- Deprecate
@VisibleForTestingfor removal #3755
β‘ Improvements
- Run OpenRewrite Java 17 recipe #3759
- Add missing module descriptor to
assertj-guava, adopt module-only build #3771 - Centralize
maven-enforcer-pluginexecution, append configurations
Core
- Replace
isSealedreflection-based implementation with JDK built-in implementation #3081 - Replace
isRecordreflection-based implementation with JDK built-in implementation #3079 - Add missing
java.sqlmodule dependency - Fix typo in
TemporalUnitLessThanOffsetJavadoc #3783 - Move script testing to separate module, improve test portability #3785
- Abort tests when symbolic links cannot be created #3788
π¨ Dependency Upgrades
Core
β€οΈ Contributors
Thanks to all the contributors who worked on this release:
@aalmiray @RaphaelJenni @SimonHarte @etrandafir93 @fml2 @Bananeweizen @lobaorn @sormuras
v3.27.3
π₯ Breaking Changes
Core
-
Revert "Propagate common basetype for the extracting method" #3737
Details
The enhancement introduced with #3673 breaks existing code on Kotlin 1.9; therefore, it has been reverted.
As Spring Boot 3.4 currently supports Kotlin 1.9, we want to keep the same compatibility on AssertJ 3.x, while AssertJ 4.x will require Kotlin 2.x.
Existing code relying on the changes introduced with #3673 will no longer compile and should be refactored.
π Bug Fixes
Core
- Fix
StandardRepresentationregression for unquoted strings #3735
β‘ Improvements
Core
- Add
Classinfo to class loading strategy failures #3746
β€οΈ Contributors
Thanks to all the contributors who worked on this release:
v3.27.2
v3.27.1
π« Deprecated
Core
- Deprecate
usingComparatorForFieldsand remove deprecated assertions fromusingComparatorForTypedocumentation #3711 - Deprecate
hasCauseReference(Throwable)fromThrowableassertions #3715
π Bug Fixes
Core
- Fix missing introspection for record accessors #3710
- Honor assertion description in
asString() - Avoid
InputStreammanipulation whenmark/resetare supported #3713 - NPE with custom
RecursiveComparisonConfigurationonusingRecursiveFieldByFieldElementComparator#3719
β‘ Improvements
- Declare license using SPDX identifier #3718
β€οΈ Contributors
Thanks to all the contributors who worked on this release:
v3.27.0
π₯ Breaking Changes
Core
-
Propagate common basetype for
extracting(Function...)#3673Details
Before this change,
extracting(Function...)changedactualto a list ofObjectinstances, even in cases where the resulting objects could have had a more specific common supertype. With this change, the element type of the returned list is narrowed down to the common supertype of the resulting elements, allowing the compiler to accept chained assertions specific to the common supertype.However, this can break existing code, like in #3709. Such cases do not justify reverting the change. Therefore, the affected code should be refactored accordingly, given that
containsfor list assertions already follows the same semantic.In addition, this can break existing code based on Kotlin 1.9, like in #3728. In such cases, either upgrade Kotlin to 2.x or upgrade AssertJ to 3.27.3, which restores compatibility with Kotlin 1.9.
π« Deprecated
Core
- Deprecate
ClassBasedNavigableIterableAssertandClassBasedNavigableListAssert#3529
β¨ New Features
Core
- Add
actual()to access the object under test #3489 - Add
isCompletedWithValueMatchingWithintoCompletableFutureassertions #3506 - Add
completesExceptionallyWithintoCompletableFutureassertions #3597 - Add
inBinarytoCharSequenceassertions #3600 - Support for
Assertions.byLessThan(Duration)andAssertions.within(Duration)#3486 - Add standard representation for
CharSequence#3617 - Add predicate descriptions overloads to
anyMatchandnoneMatch#3639 - Add
doesNotMatch(Predicate)#3684 - Add
usingEqualsaccepting aBiPredicateand an optional description to provide a custom comparison in assertions #3678
Guava
- Add
isNotEmptytoTableassertions #3559
π Bug Fixes
Core
- Recursive assertion
hasNoNullFieldsthrows NPE with fields of anonymous and local types #3534 - Fix incorrect mutation of
actualElementsGroupedByHashCodein recursive comparison - Recursive comparison
ignoringFieldsnot working properly with maps #2988 - Custom representation ignored when describing expected items not in the actual list #3646
hasFieldOrPropertyWithValueswallows exceptions thrown by getters, and reports non-existent property instead #3563satisfies()with nested assertions obscures stack trace #2542- Recursive comparison fails if ignored fields are not found in
expected#3226
β‘ Improvements
Core
- Report all failing conditions when using
satisfies(allOf(Condition...))#3537 - Fix Unicode escapes in
inUnicode()Javadoc - Show error differences if values were compared with
equalsin recursive comparison #3209 - Add throwable stacktrace to
ShouldNotContainCharSequence - Remove unused code and other minor cleanup #3683
- Simplify comparison strategy
isLessThanandisLessThanOrEqualToinAbstractComparisonStrategy#3694 - Update
AbstractCharSequenceAssert.javareference #3700 - Include stack trace of internal errors in all/any satisfy assertions
π¨ Dependency Upgrades
Core
Guava
- Upgrade to Guava 33.4.0-jre #3705
β€οΈ Contributors
Thanks to all the contributors who worked on this release:
@JunHyungJang @mipo256 @vladykin @Marcono1234 @sunaleed @etrandafir93 @FlorianCousin @OlivierCavadenti @jh-instant @patrickuhlmann @IvoHD @alexandra-junghans @fmbenhassine @etrandafir93 @shaikhu @cookieMr @emmanuel-ferdman @mk868
v3.26.3
π§© Binary Compatibility
The release is:
- Binary compatible with the previous minor version.
- Binary incompatible with the previous patch version.
π₯ Breaking Changes
Core
- Replace
assertThat(Temporal)withassertThatTemporal(Temporal)#3519
π Bug Fixes
Core
- Fix Javadoc rendering on
FactoryBasedNavigableListAssert::assertThat - Allow
ComparingNormalizedFieldsinstances to be reused across different assertions #3493
π¨ Dependency Upgrades
Core
Guava
- Upgrade to Guava 33.2.1-jre #3499
β€οΈ Contributors
Thanks to all the contributors who worked on this release: