AssertJ's custom assertions

If there was one reason I liked coding in Java, it'd be AssertJ and its brilliant extensibility.

The image is an example of it from bjForth

The ability to create custom assertions makes the test code concise and read naturally.

3 points · 2 comments · view on lemmy.world

2 Comments

jan75@lemmy.ml · 2 pts · 1y

Yeah, we use it as well and it can do some nice assertions while still remaining at least somewhat readable.

makuus@pawb.social · 2 pts · 1y

I’ve recently switched from a Java-exclusive team to a Python-exclusive one, and this is the one thing I truly miss: An actively-maintained library for clear, extensible, fluent assertions. Being back to the likes of assertEquals is fine and all, but not as powerful or concise.