Skip to content

Releases: assertj/assertj

v4.0.0-M1

09 Mar 23:25
Compare
Choose a tag to compare
v4.0.0-M1 Pre-release
Pre-release

🧩 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" and forRemoval = true for all deprecations #3762

Core

  • Deprecate @VisibleForTesting for removal #3755

⚡ Improvements

  • Run OpenRewrite Java 17 recipe #3759
  • Add missing module descriptor to assertj-guava, adopt module-only build #3771
  • Centralize maven-enforcer-plugin execution, append configurations

Core

  • Replace isSealed reflection-based implementation with JDK built-in implementation #3081
  • Replace isRecord reflection-based implementation with JDK built-in implementation #3079
  • Add missing java.sql module dependency
  • Fix typo in TemporalUnitLessThanOffset Javadoc #3783
  • Move script testing to separate module, improve test portability #3785
  • Abort tests when symbolic links cannot be created #3788

🔨 Dependency Upgrades

Core

  • Upgrade to Byte Buddy 1.17.1 #3773
  • Upgrade to JUnit BOM 5.12.0 #3779

❤️ Contributors

Thanks to all the contributors who worked on this release:

@aalmiray @RaphaelJenni @SimonHarte @etrandafir93 @fml2 @Bananeweizen @lobaorn @sormuras

v3.27.3

18 Jan 11:28
Compare
Choose a tag to compare

💥 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 StandardRepresentation regression for unquoted strings #3735

⚡ Improvements

Core

  • Add Class info to class loading strategy failures #3746

❤️ Contributors

Thanks to all the contributors who worked on this release:

@ccrvincent

v3.27.2

04 Jan 11:08
Compare
Choose a tag to compare

🐛 Bug Fixes

Core

  • Restore support for null-valued maps when ignoring fields #3723

v3.27.1

01 Jan 18:45
Compare
Choose a tag to compare

🚫 Deprecated

Core

  • Deprecate usingComparatorForFields and remove deprecated assertions from usingComparatorForType documentation #3711
  • Deprecate hasCauseReference(Throwable) from Throwable assertions #3715

🐛 Bug Fixes

Core

  • Fix missing introspection for record accessors #3710
  • Honor assertion description in asString()
  • Avoid InputStream manipulation when mark / reset are supported #3713
  • NPE with custom RecursiveComparisonConfiguration on usingRecursiveFieldByFieldElementComparator #3719

⚡ Improvements

  • Declare license using SPDX identifier #3718

❤️ Contributors

Thanks to all the contributors who worked on this release:

@Bananeweizen @jessicant @nith2001

v3.27.0

19 Dec 17:12
Compare
Choose a tag to compare

💥 Breaking Changes

Core

  • Propagate common basetype for extracting(Function...) #3673

    Details

    Before this change, extracting(Function...) changed actual to a list of Object instances, 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 contains for 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 ClassBasedNavigableIterableAssert and ClassBasedNavigableListAssert #3529

✨ New Features

Core

  • Add actual() to access the object under test #3489
  • Add isCompletedWithValueMatchingWithin to CompletableFuture assertions #3506
  • Add completesExceptionallyWithin to CompletableFuture assertions #3597
  • Add inBinary to CharSequence assertions #3600
  • Support for Assertions.byLessThan(Duration) and Assertions.within(Duration) #3486
  • Add standard representation for CharSequence #3617
  • Add predicate descriptions overloads to anyMatch and noneMatch #3639
  • Add doesNotMatch(Predicate) #3684
  • Add usingEquals accepting a BiPredicate and an optional description to provide a custom comparison in assertions #3678

Guava

  • Add isNotEmpty to Table assertions #3559

🐛 Bug Fixes

Core

  • Recursive assertion hasNoNullFields throws NPE with fields of anonymous and local types #3534
  • Fix incorrect mutation of actualElementsGroupedByHashCode in recursive comparison
  • Recursive comparison ignoringFields not working properly with maps #2988
  • Custom representation ignored when describing expected items not in the actual list #3646
  • hasFieldOrPropertyWithValue swallows exceptions thrown by getters, and reports non-existent property instead #3563
  • satisfies() 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 equals in recursive comparison #3209
  • Add throwable stacktrace to ShouldNotContainCharSequence
  • Remove unused code and other minor cleanup #3683
  • Simplify comparison strategy isLessThan and isLessThanOrEqualTo in AbstractComparisonStrategy #3694
  • Update AbstractCharSequenceAssert.java reference #3700
  • Include stack trace of internal errors in all/any satisfy assertions

🔨 Dependency Upgrades

Core

  • Upgrade to Byte Buddy 1.15.11 #3703
  • Upgrade to JUnit BOM 5.11.4 #3702

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

09 Jul 18:07
Compare
Choose a tag to compare

🧩 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) with assertThatTemporal(Temporal) #3519

🐛 Bug Fixes

Core

  • Fix Javadoc rendering on FactoryBasedNavigableListAssert::assertThat
  • Allow ComparingNormalizedFields instances to be reused across different assertions #3493

🔨 Dependency Upgrades

Core

  • Upgrade to Byte Buddy 1.14.18 #3531
  • Upgrade to JUnit BOM 5.10.3 #3525

Guava

  • Upgrade to Guava 33.2.1-jre #3499

❤️ Contributors

Thanks to all the contributors who worked on this release:

@genuss

v3.26.0

26 May 13:22
Compare
Choose a tag to compare

💥 Breaking Changes

Core

  • Delegate OptionalDouble value comparison to Double.compare in hasValue assertion #3411

    Details

    This fixes the comparison of NaN values which wasn't working the way the hasValue Javadoc describes.

    The previous behavior can be obtained with getAsDouble:

    assertThat(OptionalDouble.of(Double.NaN).getAsDouble()).isSameAs(Double.NaN);

🚫 Deprecated

Core

  • Deprecate ObjectAssertFactory in favor of Assertions.assertThat(Object)
  • Deprecate AssertionErrorFactory in favor of AssertionErrorCreator
  • Deprecate catchThrowableOfType(ThrowingCallable, Class) in favor of catchThrowableOfType(Class, ThrowingCallable) #2823
  • Deprecate assertThat(Iterable, AssertFactory), assertThat(Iterable, Class) and their respective then variants #3453

✨ New Features

Core

  • Support multiple AfterAssertionErrorCollected callbacks #3313
  • Add InstanceOfAssertFactory for Set instances #3325
  • Add doesNotContainKey and doesNotContainKeys to Guava Multimap assertions #3334
  • Add assertions for JDK YearMonth type #3142
  • Add TemporalAssert type #3404
  • Add ignoringFieldsOfTypesMatchingRegexes #3369
  • Add fail(Throwable) and fail() variants #3204
  • Add isPrivate to Class assertions
  • Add doesNot[Start/End]WithWhitespace methods to CharSequence assertions #3441
  • Add createAssert(ValueProvider) to AssertFactory #3377
  • Add values() navigation method to AbstractMapAssert #3297
  • Add bytes()/bytes(Charset)/bytes(String) navigation methods to AbstractStringAssert #3232
  • Add doesNotThrowAnyExceptionExcept to AbstractThrowableAssert #3261
  • Add hasPermittedSubclasses to Class assertions #3316
  • Add isUnmodifiable to Iterator assertions #3477

🐛 Bug Fixes

Core

  • Preserve original order of elements when returning duplicates on doesNotHaveDuplicates #3333
  • Make isNotEqualTo(boolean) pass when actual is null #3343
  • Fix isEqualTo comparison of Timestamp instances with Instant #3410
  • Fix Instant conversion with Date assertions #3467
  • Rebuild default date formats used to parse strings as dates when default timezone or lenient flag changes #3382

⚡ Improvements

  • Avoid duplicating maven-javadoc-plugin configuration and CSS files #3371
  • Favor additionalOption entries in maven-javadoc-plugin

Core

  • Fix typo in Javadoc #3365
  • Improve AssertFactory Javadoc
  • Add Throwable stack trace to ShouldHaveCauseExactlyInstance #3351
  • Fix typo #3422
  • Add Throwable stack trace to ShouldHaveCauseInstance #3392
  • Implement boolean assertions directly in AbstractBooleanAssert and remove Booleans internal class
  • Remove stack trace elements triggered by AssertJ in addition to AssertJ elements #3449

🔨 Dependency Upgrades

Core

  • Upgrade to Byte Buddy 1.14.16 #3487
  • Upgrade to JUnit BOM 5.10.2 #3357

Guava

  • Upgrade to Guava 33.2.0-jre #3454

❤️ Contributors

Thanks to all the contributors who worked on this release:

@Achitheus @csct3434 @armandino @sbrannen @shaikhu @ryber @ranjitshinde91 @tmvlpl @valery1707 @izeye @yyytir777 @pbacz @biergit @Banuelorigni @java-coding-prodigy @vlsi @hazendaz @Kruschenstein @etrandafir93 @pbacz @dehasi

v3.25.3

04 Feb 22:04
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Lock maven-clean-plugin version for all modules

Core

  • Fix a performance regression in the recursive comparison related to FieldLocation #3350
  • Don't fail when the recursive comparison checks compared fields in collection elements #3349 (proper fix: #3354)

❤️ Contributors

Thanks to all the contributors who worked on this release:

@ash211

v3.25.2

24 Jan 13:53
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Fix unresolvable Javadoc stylesheet URLs, simplify configuration #3324

Core

  • Fix missing configuration for MatcherAssert soft assertions
  • Make deprecation notice visible in AbstractAssert#asList #3327
  • Recursive comparison uses equals on root object when useOverriddenEquals is enabled #3320
  • satisfiesExactlyInAnyOrder fails if actual overrides equals #3339
  • Avoid calling actual.hashCode() and expected.hashCode() in DualValue #3340
  • Recursive comparison checks for existence of fields in types that parameterize nested unordered iterables #3332

❤️ Contributors

Thanks to all the contributors who worked on this release:

@manusa @davidboden

v3.25.1

02 Jan 23:48
Compare
Choose a tag to compare

🧩 Binary Compatibility

The release is:

  • Binary compatible with the previous minor version.
  • Binary incompatible with the previous patch version.

🐛 Bug Fixes

Core

  • Revert "Provide value when assertThatThrownBy/thenThrownBy fail" #3318
  • Revert "fix: containsExactly does not work properly with maps not using equals to compare keys" #3321