AssertJ like a pro
summary
AssertJ replaces fragile JUnit-style asserts with concrete AssertJ features: singleElement to unwrap one-item collections, isCloseTo for tolerant temporal comparisons, and soft assertions to run multiple checks without aborting. It also shows shrinking validation-heavy tests by extracting reusable Condition objects and by creating custom assertions that extend AbstractAssert with a static factory method so tests read as domain-specific fluent checks; the benefit is readability and maintainability rather than runtime speedup.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:24AssertJ library
- 2:49Collection assertions
- 4:33Multiple assertions
- 5:56Temporal data assertions
- 7:01Business rule validation
- 8:47Refactoring with conditions
- 10:32Custom assertions
- 12:36Going further with AssertJ
- 13:59Conclusion
- 14:21Q&A








