Here’s a list of all the features that you can expect from JUnit Pioneer. For some of them you need to be quite familiar with JUnit 5, so make sure to read its user guide or this article series.
- Convert Number Argument to Byte Array
- The JUnit 5 (Jupiter) argument converter `@NumberToByteArrayConversion` converts the number value of an argument to its byte array representation
- Cartesian Product of Parameters
- The JUnit 5 (Jupiter) extension `@CartesianTest` adds a variant of parameterized tests that executes a test for each possible combination of input arguments
- Default Locale and TimeZone
- The JUnit 5 (Jupiter) extensions `@DefaultLocale` and `@DefaultTimeZone` change the runtime's default locale and time zone as returned from `Locale.getDefault()` and `TimeZone.getDefault()` for the duration of a test
- Disable Tests if Others Fail
- The JUnit 5 (Jupiter) extension @DisableIfTestFails disables all tests in a class once the first test failed
- Disable Parameterized Test
- The JUnit 5 (Jupiter) extensions `@DisableIfDisplayName`, `@DisableIfArgument`, and more selectively disable parameterized tests based on their display name or argument values
- Disable a Test Temporarily
- The JUnit 5 (Jupiter) extension `@DisabledUntil` temporarily disables a test until a certain date
- Clear, Set, and Restore Environment Variables
- The JUnit 5 (Jupiter) extensions `@ClearEnvironmentVariable`, `@SetEnvironmentVariable` and `@RestoreEnvironmentVariables` clear/set/restore the values of environment variables for the duration of a test, and/or restore them after
- Expected-to-Fail Tests
- The JUnit 5 (Jupiter) extension `@ExpectedToFail` marks a test method as 'expected to fail', which marks a failing test as aborted and a passing test as failed
- Fail test after certain date
- The JUnit 5 (Jupiter) extension `@FailAt` fails a test after a certain date
- Issue Information
- The JUnit 5 (Jupiter) extension `@Issue` associates test information (e.g. passed or failed) an issue number
- JSON Argument Source
- The JUnit 5 (Jupiter) extensions `@JsonSource`, `@JsonFileSource`, and `@JsonClasspathSource` allow passing arguments to a parametrized test that where read from inline JSON or a JSON file
- Range Sources
- The JUnit 5 (Jupiter) extensions `@IntRangeSource`, `@FloatRangeSource`, etc. provide series of numbers as argument sources for parameterized tests
- ReplaceCamelCaseAndUnderscoreAndNumber
- New display name generator extending `org.junit.jupiter.api.DisplayNameGenerator.Standard` to support CamelCase, underscores and numbers
- Publishing Report Entries
- The JUnit 5 (Jupiter) extension `@ReportEntry` declaratively publishes report entries via the `TestReporter`
- Injecting Resources
- A JUnit 5 (Jupiter) extension mechanism to create, share, and inject resources like temporary directories or a port
- Retrying Failing Tests
- The JUnit 5 (Jupiter) extension `@RetryingTest` retries a failing test a certain number of times; only marking the test failed if no execution passes
- Simple Arguments Aggregator
- The JUnit 5 (Jupiter) extension `@Aggregate` aggregates supplied values into a single parameter for a `@ParameterizedTest`
- Standard Input and Output
- The JUnit 5 (Jupiter) extension `@StdIo` simulates standard input to `System.in` and captures standard output to `System.out` or `System.err` for assertions
- Measuring Test Run Time
- The JUnit 5 (Jupiter) extension `@Stopwatch` measures elapsed time of a test method
- Clear, Set, and Restore System Properties
- The JUnit 5 (Jupiter) extensions `@ClearSystemProperty`, `@SetSystemProperty` and `@RestoreSystemProperties` clear/set/restore the values of system properties for the duration of a test, and/or restore them after
- Injecting Temporary Directories
- The JUnit 5 (Jupiter) extension `@Dir` allows to create, share, and inject temporary directories as arguments
- Vintage @Test
- The JUnit 5 (Jupiter) extension `@Test` is a drop-in replacement for JUnit 4's `@Test` annotation, including `expected` and `timeout`
To start using JUnit Pioneer, determine the latest version (e.g. on Maven Central) and add org.junit-pioneer : junit-pioneer
as a test dependency.