Here we going to figure out few tips how to make your test failures more informative, clear and valuable with AssertJ custome messages.
AssertJ Maven dependency
Check the current available version - AssertJ
By default AssertJ assertion failures
give fail mesagges like this:
We can’t see what exactly the failure is about.
Let’s tune it a little with
We also can completely replace the failure message with our custome message using
And the last thing - don’t forget to give clear and informative names to test classes and test methods.
You may also find these posts interesting: