For anyone looking to play along, the following need to be installed:
- A Java IDE (i.e. IntelliJ IDEA Community Edition)
- Maven
- Java 11 JDK (i.e. Adopt Open JDK 11)
- A local clone of this Project
This repository is a single maven module with a fizz buzz application package. The application is only used to provide an interface to test. The test folder contains the demonstration of Junit 5. The test folder is separated into two packages. The first containing example test classes used to demonstrate the same tests written in different ways. The second folder contains the various testing utility implementations.
The project POM declares a few dependencies, and uses base-pom-minimal to enable and set sane default for various maven plugins. These plugins generally fail the build in the event of a failure (check style, bad dependency declarations, find bugs errors, unit/integration test failures, etc).
To build the project and run all the tests run:
mvn clean install
To build without running the tests:
mvn clean install -D skipTests
To run tests from a single test class:
mvn test -D test=ExampleTest
To run a single test method:
mvn test -D test=ExampleTest#testStaticMethods
To Run the application after building it:
java -jar -Dkey=value ./target/declarative-jupiter.jar
To Run the application passing in your own number:
java -jar -Dkey=value ./target/declarative-jupiter.jar 1 2 3 4 5 6 7
- Junit 5 User Guide:
- Using Junit5 Blog Series:
- Example Extensions from Junit Pioneer:
- Junit 5 Extensions Overview: