Better Assertions with AssertJ
Not all testing libraries are equal. Sure they all run your tests, but what happens when they fail? “Expected ‘true’, was ‘false’” won’t help you much. Your choice of library determines whether you can immediately jump to a fix, or first have to debug for more details. And with JUnit 6 and AssertJ 4 now available, it’s high time for an upgrade!
In this talk we’ll explore AssertJ, and the fluent assertions API it provides. We’ll contrast this to alternatives like JUnit and Hamcrest, and show how subtle differences improve the experience. Now you can finally have unified fluent assertions for all your tests, with a clear path to get there.
For existing AssertJ users we will optimize its use to get more expressive assertions and meaningful messages from existing tests. Finally, a quick few OpenRewrite recipes help you apply all these best practices at once, and continuously going forward.


