Wednesday, July 24, 2013

Monday, July 15, 2013

Sunday, July 14, 2013

Test code readability improved: JUnit with Mockito and FEST Fluent Assertions

To improve the readability of my unit tests I use assertThat with Hamcrest matchers. This is a good way to improve readability of your test code, especially when I statically import members of like org.junit.Assert.assertThat and org.hamcrest.Matchers. But when I add Mockito matchers on top of it, I experienced the problem of static import conflicts that ended up with "not nice" code (according to my definition).