/declarative-jupiter

A Collection of Declarative Jupiter Examples

Primary LanguageJavaMIT LicenseMIT

Declarative Jupiter

A Project to Demonstrate a Declarative Approach to Using Junit 5 Jupiter

Prerequisites

For anyone looking to play along, the following need to be installed:


Project Details

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).


Using the project from the commandline

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

Other Resources