JUnit 5 Maven config

Posted by Uwe Schaefer on Mon, Jun 25, 2018
In: Java Test
Tags: java test junit junit5

What & Why

My team was discussing (once more) of how to categorize Tests, so that fast unit Tests can be distinguished by any tool from slower ones and from integration tests.

We tried naming conventions before (heritage from company legacy), but now thought about splitting source paths.

I don’t like to diverge from maven’s filesystem layout, so i though i’d have a (long overdue) look at JUnit5.

Example project

To sum up: there is lots of very good documentation out there about JUnit5, and you should consider switching for a ton of reasons, i wont get into here.

In case you want an example, of how this would look like in terms of maven configuration, you can find an example project here.

Extension Model

In order to play with the extension model, i created a tiny wrapper project for embedded Redis to use with spring boot. This is much more intuitive and useable compared to JUnit4, i have to admit.

Links