I have started to use the corematchers from org.hamcrest, and find them very useful and easy to understand. They give a grammatical touch to my assert-statements that the regular assertEquals(...) does not. E.g. assertTrue(a > 0) can be written as assertThat( a , is(greaterThan(0))), which can be easier for non-technical people to understand.
Anyway, to avoid manual static imports, let eclipse do the job for you. Configure it as follows:
No comments:
Post a Comment