This document contains the change log for all JUnit 5 releases since 5.11 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.12.0-M1
Date of Release: ❓
Scope: ❓
For a complete list of all closed issues and pull requests for this release, consult the 5.12.0-M1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
Fix support for disabling ANSI colors on the console when the
NO_COLOR
environment variable is available.
New Features and Improvements
-
Introduce
ReflectionSupport.makeAccessible(Field)
for third-party use rather than calling the internalReflectionUtils.makeAccessible(Field)
method directly. -
Support both the primitive type
void
and the wrapper typeVoid
in the internalReflectionUtils
to allowString
toClass
conversion in parameterized tests.
JUnit Jupiter
Deprecations and Breaking Changes
-
When injecting
TestInfo
into test class constructors it now contains data of the test method the test class instance is being created for unless the test instance lifecycle is set toPER_CLASS
(in which case it continues to contain the data of the test class). If you require theTestInfo
of the test class, you can implement a class-level lifecycle method (e.g.,@BeforeAll
) and injectTestInfo
into that method. -
When injecting
TestReporter
into test class constructors the published report entries are now associated with the test method rather than the test class unless the test instance lifecycle is set toPER_CLASS
(in which case they will continue to be associated with the test class). If you want to publish report entries for the test class, you can implement a class-level lifecycle method (e.g.,@BeforeAll
) and injectTestReporter
into that method.
New Features and Improvements
-
In a
@ParameterizedTest
method, anull
value can now be supplied for Java Date/Time types such asLocalDate
if the newnullable
attribute in@JavaTimeConversionPattern
is set totrue
. -
ArgumentsProvider
(declared via@ArgumentsSource
),ArgumentConverter
(declared via@ConvertWith
), andArgumentsAggregator
(declared via@AggregateWith
) implementations can now use constructor injection from registeredParameterResolver
extensions. -
Extensions based on
TestTemplateInvocationContextProvider
can now allow returning zero invocation contexts by overriding the newmayReturnZeroTestTemplateInvocationContexts
method. -
The new
@ParameterizedTest(requireArguments = false)
attribute allows to specify that the absence of arguments is expected in some cases and should not cause a test failure. -
Allow determining "shared resources" at runtime via the new
@ResourceLock#providers
attribute that accepts implementations ofResourceLocksProvider
. -
Extensions that implement
TestInstancePreConstructCallback
,TestInstanceFactory
,TestInstancePostProcessor
,ParameterResolver
, orInvocationInterceptor
may override thegetTestInstantiationExtensionContextScope()
method to enable receiving a test-scopedExtensionContext
inExtension
methods called during test class instantiation. This behavior will become the default in future versions of JUnit. -
@TempDir
is now supported on test class constructors.
5.11.3
Date of Release: ❓
Scope: Bug fixes and enhancements since 5.11.2
For a complete list of all closed issues and pull requests for this release, consult the 5.11.3 milestone page in the JUnit repository on GitHub.
5.11.2
Date of Release: October 4, 2024
Scope: Bug fixes and enhancements since 5.11.1
For a complete list of all closed issues and pull requests for this release, consult the 5.11.2 milestone page in the JUnit repository on GitHub.
5.11.1
Date of Release: September 25, 2024
Scope: Bug fixes and enhancements since 5.11.0
For a complete list of all closed issues and pull requests for this release, consult the 5.11.1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
Fix support for disabling ANSI colors on the console when the
NO_COLOR
environment variable is available. -
NamespacedHierarchicalStore
no longer throws an exception after it has been closed if the store is queried via one of theget(…)
orgetOrComputeIfAbsent(…)
methods; however, if agetOrComputeIfAbsent(…)
invocation results in the computation of a new value, an exception will still be thrown. -
Fixed potential locking issue with
ExclusiveResource
in theHierarchicalTestExecutorService
, which could lead to deadlocks in certain scenarios.
5.11.0
Date of Release: August 14, 2024
Scope:
-
@FieldSource
annotation for use with@ParameterizedTest
methods -
Repeatable
@..Source
annotations for parameterized tests -
Enhancements for authoring dynamic and parameterized tests
-
@AutoClose
annotation to automatically close field resources in tests -
ConversionSupport
utility for converting from a string to a supported target type -
Extensible syntax for specifying discovery selectors
-
@BeforeSuite
and@AfterSuite
annotations -
Classpath resource scanning support for engines
-
Numerous bug fixes and enhancements regarding field and method search algorithms
For complete details consult the 5.11.0 Release Notes online.