To FEST or not to FEST?

When you write your unit tests you must use some kind of assertions. I think that most of you will agree with me on that the asserts that comes with the JUnit aren’t the easiest and most readable ones. So, some time ago I started to use a Hamcrest matcher library. It was a great progress, as I was able to move away from JUnit’s unintuitive: assertEquals(11.0, actual). I mean, if you try to read it out loud it doesn’t seem very logical:...

April 27, 2012 · 3 min

Content Assist With Static Imports in Eclipse

If you’re using Eclipse and working with a class with a lot of static members, you might be affected by the problem of lack of content assist and automatic import for such members. Let’s say you’re using a Hamcrest matchers; you need a is(), notNullValue(), hasEntry() and so on (there are plenty of those). You don’t want to type Matchers.hasEntry() every time you use it in your code. Hey, that’s not why the fluent API was invented in the first place!...

April 26, 2012 · 2 min