This document contains the change log for all JUnit 5 releases since 5.6 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.7.0-M1
Date of Release: April 19, 2020
Scope:
-
New
@EnabledIf/@DisabledIfannotations for conditional execution based on method calls -
New
MethodOrderernamedDisplayNamethat orders methods based on their display names -
New
DisplayNameGeneratornamedSimplethat removes parentheses for empty parameter lists -
assertThrows()for Kotlin can now be used with suspending functions -
TestExecutionListenerdeactivation via a configuration parameter -
EngineTestKitnow allows for testing post-discovery filtering and pruning -
Improved interoperability with Spock for the Vintage test engine
For a complete list of all closed issues and pull requests for this release, consult the 5.7 M1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Deprecations and Breaking Changes
-
In the
EngineTestKitAPI, theall(),containers(), andtests()methods inEngineExecutionResultsthat were deprecated in JUnit Platform 1.6.0 have been removed in favor ofallEvents(),containerEvents(), andtestEvents(), respectively. -
The following methods in
EngineTestKitare now deprecated with replacements:-
execute(String, EngineDiscoveryRequest)→execute(String, LauncherDiscoveryRequest) -
execute(TestEngine, EngineDiscoveryRequest)→execute(TestEngine, LauncherDiscoveryRequest) -
Builder.filters(DiscoveryFilter…)→Builder.filters(Filter…)
-
New Features and Improvements
-
The number of containers and tests excluded by post discovery filters based on their tags is now logged, along with the exclusion reasons.
-
New
junit.platform.execution.listeners.deactivateconfiguration parameter that allows one to specify a comma-separated list of patterns for deactivatingTestExecutionListenerimplementations registered via theServiceLoadermechanism. -
The
@Testableannotation may now be applied directly to fields. -
New
Node.DynamicTestExecutor#execute(TestDescriptor, EngineExecutionListener)method for engines that wish to provide a customEngineExecutionListenerand cancel or wait for the execution of a submitted test via the returnedFuture. -
New
EngineExecutionListener.NOOPEngineExecutionListenerimplementation. -
All declared methods in the
EngineExecutionListenerAPI now have emptydefaultimplementations. -
The
EngineTestKitnow reuses the same test discovery and execution logic as theLauncher. Thus, it’s now possible to test an engine’s behavior in the presence of post-discovery filters (e.g. tag filters) and with regard to pruning. -
The
EngineTestKitnow supports matching conditions with events loosely, i.e. an incomplete match with or without a fixed order.
JUnit Jupiter
Bug Fixes
-
@TempDiris now able to clean up files in read-only directories. -
The Jupiter engine now ignores
MethodSelectorsfor methods in non-Jupiter test classes instead of failing for missing methods in such cases.
New Features and Improvements
-
New
@EnabledIfand@DisabledIfannotations can be used to enable or disable a test or container based on condition methods. -
New
MethodOrderernamedDisplayNamethat sorts test methods alphanumerically based on their display names. -
New
DisplayNameGeneratornamedSimple(based onStandard) that removes trailing parentheses for methods with no parameters. -
assertThrows()for Kotlin can now be used with suspending functions and other lambda contexts that require inlining. -
The
JREenum now provides a staticcurrentVersion()method that returns the enum constant for the currently executing JRE, e.g. for use in custom execution conditions and other extensions. -
The
nameattribute of@ParameterizedTestis now clearly documented to be aMessageFormatpattern. -
Synthetic constructors are now ignored when instantiating a test class.
-
The Javadoc for the
provideTestTemplateInvocationContexts()method inTestTemplateInvocationContextProviderhas been aligned with the actual implementation. Providers are now officially allowed to return an empty stream, and the error message when all provided streams are empty is now more helpful. -
New
getDisplayName()method inMethodDescriptorfor use inMethodOrdererimplementations.
5.6.2
Date of Release: April 10, 2020
Scope: Bug fixes since 5.6.1
For a complete list of all closed issues and pull requests for this release, consult the 5.6.2 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
ReflectionSupport.findNestedClasses()no longer detects inner class cycles for classes that do not match the suppliedPredicate. For example, JUnit Jupiter no longer throws an exception if an inner class cycle is detected in a nested class hierarchy whose inner classes are not annotated with@Nested.
5.6.1
Date of Release: March 22, 2020
Scope: Bug fixes since 5.6.0
For a complete list of all closed issues and pull requests for this release, consult the 5.6.1 milestone page in the JUnit repository on GitHub.
5.6.0
Date of Release: January 20, 2020
Scope:
-
New
@EnabledForJreRangeand@DisabledForJreRangeexecution conditions -
@Orderallows to specify relative order -
Parameter names are included in default display names of parameterized test invocations
-
Improvements to
@CsvSourceand@CsvFileSource -
New
TestInstancePreDestroyCallbackextension API -
Performance improvements and bug fixes for the Vintage engine
-
Improved error reporting for failures during test discovery and execution
-
Support for using
any()andnone()in tag expressions -
org.junit.platform.consolenow provides ajava.util.spi.ToolProvider -
DiscoverySelectorsfor tests in inherited nested classes -
OSGi metadata
-
Minor bug fixes and improvements
For complete details consult the 5.6.0 Release Notes online.