Better Assertions with AssertJ
summary
Argues that AssertJ fluent assertions replace terse JUnit/Hamcrest failures with expressive chained checks, custom assertion providers, soft assertions and clearer exception testing; shows concrete migrations using OpenRewrite migration recipes (sample app reports ~1 hour saved) and a GitHub Action that posts one‑click code suggestions; demonstrates replacing Hamcrest collection checks, collapsing chained asserts, and adopting Spring Framework 6.2 / MockMvcTester for unified assertions (MockMvcTester support), and reports these automated changes work on the demo repo.
AI-written summary · about
chapters (12)
- 0:00Introduction to AssertJ
- 4:14Better assertions in testing
- 13:48History of Java assertion libraries
- 22:37Why AssertJ improves older libraries
- 26:12Favorite AssertJ features
- 27:39Custom assertion providers
- 32:58Soft assertions and failure messages
- 35:07Migrating to AssertJ with OpenRewrite
- 39:00AssertJ with Spring MockMVC
- 41:50Enforcing AssertJ patterns
- 45:25Implementing AssertJ automation rules
- 46:31Q&A








