Sounds very familiar to me :P

Just a tiny thing, use “import static” where is applicable to don’t get bothered or reading “Mockito.blahblah” or “Assert.assertThat” blah blah.

Also consider the usage of “Hamcrest” to make the assertions as readable as possible.

Ah! and another fancy way to check if your method thrown an exception (and if, for example, the exception contains an expected message) is using @Rule annotation.

    Jesús María Villar

    Written by

    Backend Engineer at @bestsecret - Java is more than an Island :D contact me at: jesus.villar@bestsecret.com

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade