3 ms·
Recommending AssertJ and not mentioning Hamcrest? Hamcrest is more flexible, more composable, and more extensible.
by twic 6y ago
Recommending AssertJ and not mentioning Hamcrest? Hamcrest is more flexible, more composable, and more extensible.
- joshka 6y agoHaving used both extensively, AssertJ's API is more obvious and generally useful out of the box. It's replaced all the places where I'd previously used custom Hamcrest matchers with generally smaller amounts of code that spit out better errors when tests fail. It's not a either or though, sometimes it's worth looking at whether hamcrest is the right approach.