Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[JUG CH - LU] What's wrong with AssertJ?!

Avatar for Stefano Cordio Stefano Cordio
July 01, 2026
37

[JUG CH - LU] What's wrong with AssertJ?!

Avatar for Stefano Cordio

Stefano Cordio

July 01, 2026

Transcript

  1. Stefano Cordio J u l y 1 s t ,

    2 0 2 6 What’s Wrong with AssertJ?! How a decade of technical debt is addressed in version 4
  2. Supported Types • boolean, boolean[], boolean[][] • byte, byte[], byte[][]

    • char, char[], char[][] • short, short[], short[][] • int, int[], int[][] • long, long[], long[][] • float, float[], float[][] • double, double[], double[][] Primitives • CompletableFuture • CompletionStage • Future java.util.concurrent • DoublePredicate • IntPredicate • LongPredicate • Predicate java.util.function • Boolean • Byte • Character • CharSequence • Class • Comparable • Double • Float • Integer • Iterable • Long • Object[] • Short • String • StringBuffer • StringBuilder • Throwable java.lang • Duration • Instant • LocalDate • LocalDateTime • LocalTime • OffsetDateTime • OffsetTime • Period • YearMonth • ZonedDateTime java.time • Collection • Date • HashSet • Iterator • List • Map • Optional • OptionalDouble • OptionalInt • OptionalLong • Spliterator java.util • DoubleStream • IntStream • LongStream • Stream java.util.stream • File • InputStream java.io • URI • URL java.net • BigDecimal • BigInteger java.math • Path java.nio.file • SQLException java.sql • Matcher java.util.regex • AtomicBoolean • AtomicInteger • AtomicIntegerArray • AtomicIntegerFieldUpdater • AtomicLong • AtomicLongArray • AtomicLongFieldUpdater • AtomicMarkableReference • AtomicReference • AtomicReferenceArray • AtomicReferenceFieldUpdater • AtomicStampedReference • LongAdder java.util.concurrent.atomic
  3. AssertJ Core AssertJ Guava AssertJ Generator joel-costigliola Joel Costigliola scordio

    Stefano Cordio AssertJ Vavr Grzegorz Piwowarek pivovarit AssertJ DB VanRoy Julien Roy AssertJ Neo4j Florent Biville fbiville AssertJ Swing Christian Rösch croesch Matt Bertolini mattbertolini AssertJ Eclipse Collections Riccardo Cardin rcardin AssertJ Arrow Core AssertJ Protobuf The Team filiphr Filip Hrisafov Nava2 Kevin Brightwell
  4. The AssertJ History FEST Assert 1.x 2.x 3.x 4.x 2009

    2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2027 2026 1.0 1.4 1.0 1.7.1 2.0 2.9.1 3.0 3.27.7 Fork! 3.28 2.3 2.6 2.7 2.9 3.3 3.6 3.8 3.10 3.13 3.17 3.20 3.22 3.24 3.26 3.27 1.6 Java 8 Java 17 Java 7 4.0-M1 4.0 4.0-M2
  5. Entry Points Ambiguities • Multiple unrelated interface overloads • CharBuffer

    matching assertThat(CharSequence) and assertThat(Comparable) • Bounded type as <T extends X> with X contributing to overload competition • Date subtype matching assertThat(Date) and assertThat(Comparable)
  6. Entry Points Target • Single set of assertThat methods in

    Assertions • Explicit assertThat<Type> helpers only for ambiguity cases • Deprecation in 3.28, removal in 4.0
  7. Inconsistent Return Types Abstract class → Contract Remove “Abstract” prefix

    Concrete class → Implementation details Never public, controlled instantiation via factory methods
  8. Soft Assertions Performance penalty due to proxying at runtime with

    Byte Buddy Alternatives: • Byte Buddy proxying at compile time • Source code generation (JavaPoet, Java Template Engine) • Explicit wrapping logic ✓ Recently contributed by filiphr Filip Hrisafov
  9. 3.28 → 4.0 Migration with OpenRewrite Assertions for New JDK

    Classes Multi-release JAR to support JDK types > 17 Diff-like Error Messages for Strings and Collections MCP Server for LLM Integration? AssertJ Incubator?
  10. User Guide with Antora Javadoc Markdown and Executable Snippets Integration

    Testing with Popular Projects (Spring, JUnit, Mockito, etc.)
  11. For Java 17 Or Java 8 (3.x) With Java 25

    The latest and greatest build-time goodies from the JDK Java Module System and OSGi Native
  12. GitHub Secure Open Source Fund (2025) Spotify FOSS Fund (2023)

    “This Java library helps engineers write clean tests by making assertions and errors much more readable than with plain JUnit or other libraries. Used in many of our critical tests, it’s found in 764 of our repositories containing production components.” “Investing in security for fast-growing dependencies that support larger projects can mitigate risks and enhance OSS security, especially in the age of AI. Providing funding directly to maintainers enables them to focus on security while giving them expert guidance and emergency support.”
  13. GitHub Secure Open Source Fund Top Learnings • Limited attack

    surface • Resilience to Supply Chain Attacks • Dependencies and GitHub Actions • Mindset shift Upcoming Milestones • Incident Response Plan • Threat Modeling • Fuzzing Community • Direct contact with GitHub Security experts • Collaboration with major Open Source projects • Fast-lane to GitHub Product Teams • Issues, Actions, Dependabot, CodeQL • Feeling supported and not left alone in Nebraska
  14. Get in touch assertj/assertj Use Cases • Missing Features •

    Friction Try Out Milestone Versions Snapshots, too, if you are brave!