AssertJ, writing tests just got simpler

I’m a huge fan of FEST-Assert. I’ve been using the version 1 since 2008 or something. I made people switch to FEST. I presented FEST at the Paris JUG. I used FEST for almost all my Brown Bag Lunches. And now I don’t use it anymore…


Yes, I don’t use FEST-Assert anymore. It failed to evolve quickly enough. Like any other Api, an assertions Api needs to evolve.

So what do I use?

I’ve using AssertJ on all my projects for a couple of months. It’s a fork of FEST that has proved it could evolve very quickly. It was launched during Devoxx France, last year and now it provides a awful lot of nice fluent assertions. Here a sample taken from one of my BBLs:

Here is the FEST-Assert code:

Here is the AssertJ code:

Notice how much more compact it is and still easy to read? Also it will break if you add new fields to Item that don’t follow the contract. It means you’re writing tests that are easier to maintain. That’s nice!