Welcome to JUnit 5 Samples, a collection of sample applications and extensions using JUnit Jupiter, JUnit Vintage, and the JUnit Platform on various build systems.
CI builds for sample projects are available on Jenkins and Travis CI.
Using JDK 10's jshell
tool, you may build all samples via the build-all-samples.jsh
script.
Basic setups showing how to get started.
The junit5-vanilla-gradle sample demonstrates the bare minimum configuration for getting started with JUnit Jupiter using the Gradle build system.
The junit5-vanilla-maven sample demonstrates the bare minimum configuration for getting started with JUnit Jupiter using the Maven build system.
More complex setups how to integrate various parts of "JUnit 5".
The junit5-gradle-consumer sample demonstrates how to set up a Gradle project using the JUnit Platform, JUnit Jupiter, and JUnit Vintage.
The junit5-maven-consumer sample demonstrates how to set up a Maven project using the JUnit Platform, JUnit Jupiter, and JUnit Vintage.
The junit5-mockito-extension sample provides a simple extension that demonstrates how one can integrate Mockito into JUnit Jupiter tests.
Living in the Modular World...
The junit5-modular-world sample demonstrates how to test code organized in modules. This sample also demonstrates how to implement a custom TestEngine for the JUnit Platform using the Java Platform Module System.