This document contains the change log for all JUnit 5 releases since 5.8 GA.
Please refer to the User Guide for comprehensive reference documentation for programmers writing tests, extension authors, and engine authors as well as build tool and IDE vendors.
5.9.0-M1
Date of Release: May 15, 2022
Scope:
-
XML reports in new Open Test Reporting format
-
Configurable cleanup mode for
@TempDir -
New
TestInstancePreConstructCallbackextension API -
Reusable parameter resolution for custom extension methods via
ExecutableInvoker -
New
IterationSelector -
Various improvements to
ConsoleLauncher
For a complete list of all closed issues and pull requests for this release, consult the 5.9 M1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
Fixed handling of global post-discovery filters that apply to
@Suiteclasses. -
Since the Turkish language has special characters such as 'ı' and 'İ', the uppercase conversion in
DefaultParallelExecutionConfigurationStrategy#getStrategypreviously caused all tests to finish with exit code -1. This has been fixed by using the root locale instead of the default one.
Deprecations and Breaking Changes
-
ConfigurationParameters.size()has been deprecated in favor of the newkeySet()method.
New Features and Improvements
-
Support for the Open Test Reporting format which supports all features of the JUnit Platform such as hierarchical test structures, display names, tags, etc. Please refer to the User Guide for instructions on how to enable such reports in your build.
-
ConfigurationParametershas a newkeySet()method which allows you to retrieve all configuration parameter keys. -
New
IterationSelectorfor selecting a subset of a test’s or container’s iterations. -
ParallelExecutionConfigurationallows configuring thesaturatepredicate of theForkJoinPoolused for parallel test execution. -
JUnit OSGi bundles now contain
engineandlauncherrequirements ensuring that at resolution time a fully running set of dependencies is calculated, avoiding the need for these to be manually specified. -
JUnit Platform Standalone Console JAR now also includes the JUnit Platform Suite Engine.
-
New
failIfNoTestsattribute added to@Suite. This will fail the suite if no tests are discovered. -
The output color for the
ConsoleLaunchercan now be customized. The option--single-colorwill apply a built-in monochrome style, while--color-palettewill accept a properties file. See the User Guide for details. -
The default theme for the
ConsoleLauncheris now determined by the charset reported by the system console on Java 17 and later. -
New
--list-enginesoption added to theConsoleLauncherwhich displays all registered test engine implementations. -
Configuring included
EngineFiltersthat do not match any registeredTestEngineresults in an error to avoid misconfiguration – for example, due to typos.
JUnit Jupiter
Bug Fixes
-
When cleaning up a
@TempDir, only one retry attempt will be made to delete directories. -
Since the Turkish language has special characters such as 'ı' and 'İ', the uppercase conversion in
DefaultParallelExecutionConfigurationStrategy#getStrategypreviously caused all tests to finish with exit code -1. This has been fixed by using the root locale instead of the default one.
Deprecations and Breaking Changes
-
@TempDirfields are no longer allowed to be declared asfinal.-
This improves diagnostics for failures resulting from a user-declared
static final@TempDirfield by throwing an exception with an informative error message.
-
New Features and Improvements
-
@TempDirnow includes acleanupmode attribute for preventing a temporary directory from being deleted after a test. The default cleanup mode can be configured via a configuration parameter. -
Support for FreeBSD and OpenBSD operating systems in
@EnabledOnOsand@DisabledOnOs. -
New
MATCH_NONEmode for@EnumSourcethat selects only those enum constants whose names match none of the supplied patterns. -
The
@Orderannotation is now aSTABLEAPI. -
New
TestInstancePreConstructCallbackextension API that is called prior to test instance construction – symmetric to the existingTestInstancePreDestroyCallbackextension API. -
Extensions can now leverage registered
ParameterResolverextensions when invoking methods and constructors via the newExecutableInvokerAPI available in theExtensionContext. -
A subset of the invocations of parameterized or dynamic tests can now be selected via the new
IterationSelectordiscovery selector when launching the JUnit Platform. -
JAVA_19has been added to theJREenum for use with JRE-based execution conditions. -
@MethodSourcefactory methods can now accept arguments resolved by registeredParameterResolverextensions.
5.8.2
Date of Release: November 28, 2021
Scope:
-
Text blocks in
@CsvSourceare treated like CSV files -
CSV headers in display names for
@CsvSourceand@CsvFileSource -
Custom quote character support in
@CsvSourceand@CsvFileSource
For a complete list of all closed issues and pull requests for this release, consult the 5.8.2 milestone page in the JUnit repository on GitHub.
JUnit Jupiter
New Features and Improvements
-
Text blocks in
@CsvSourceare now treated like complete CSV files, including support for comments beginning with a#symbol as well as support for new lines within quoted strings. See the User Guide for details and examples. -
CSV headers can now be used in display names in parameterized tests. See
@CsvSourceand@CsvFileSourcein the User Guide for details and examples. -
The quote character for quoted strings in
@CsvSourceand@CsvFileSourceis now configurable via a newquoteCharacterattribute in each annotation.
5.8.1
Date of Release: September 22, 2021
Scope:
-
Support for text blocks in
@CsvSource -
Java 18 support in the
JREenum -
Access to the
ExecutionModein theExtensionContext -
Minor bug fixes and enhancements since 5.8.0
For a complete list of all closed issues and pull requests for this release, consult the 5.8.1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Deprecations and Breaking Changes
-
@UseTechnicalNameshas been deprecated in favor of the new@Suitesupport which does not require the use of technical names. See the warning in Using JUnit 4 to run the JUnit Platform for details.
JUnit Jupiter
Bug Fixes
-
assertLinesMatch()inAssertionsno longer fails with aNoSuchElementExceptionif a limited fast-forward followed by at least one more expected line exceeds the remaining actual lines. -
assertLinesMatch()inAssertionsnow handles fast-forwards with leading and trailing spaces correctly and no longer throws anIndexOutOfBoundsException.
New Features and Improvements
-
JAVA_18has been added to theJREenum for use with JRE-based execution conditions. -
CSV content in
@CsvSourcecan now be supplied as a text block instead of an array of strings. See the User Guide for details and an example. -
The
ExecutionModefor the current test or container is now accessible via theExtensionContext.
5.8.0
Date of Release: September 12, 2021
Scope:
-
Declarative test suites via
@Suiteclasses -
LauncherSessionand accompanying listener -
New
UniqueIdTrackingListener -
More fine-grained Java Flight Recorder events
-
Java Flight Recorder support on Java 8 Update 262 or higher
-
Test class ordering
-
@TempDircan be used to create multiple temporary directories -
Extension registration via
@ExtendWithon fields and parameters -
Auto-close support for arguments in
@ParameterizedTestmethods -
Memory and performance optimizations
-
Numerous bug fixes and minor improvements
For complete details consult the 5.8.0 Release Notes online.