Date of Release: ❓
Scope: ❓
For a complete list of all closed issues and pull requests for this release, consult the 5.9.3 milestone page in the JUnit repository on GitHub.
-
Parameter types for local
@MethodSource
factory method names are now validated. For example,@MethodSource("myFactory(example.NonexistentType)")
will now result in an exception stating thatexample.NonexistentType
cannot be resolved to a valid type. -
The syntax for parameter types in local
@MethodSource
factory method names now supports canonical array names — for example, you may now specifyint[]
as in@MethodSource("myFactory(int[])"
instead of the binary name[I
as in@MethodSource("myFactory([I)"
(which was already supported) and@MethodSource("myFactory(java.lang.String[])
instead of@MethodSource("myFactory([Ljava.lang.String;)
. -
The search algorithm used to find
@MethodSource
factory methods now applies consistent semantics for local qualified method names and fully-qualified method names for overloaded factory methods. -
The
{displayName}
placeholder for@ParameterizedTest
invocation names is no longer parsed usingjava.text.MessageFormat
. Consequently, any text in the display name of the@ParameterizedTest
method will be included unmodified in the invocation display name. For example, Kotlin method names and custom display names configured via@DisplayName
can now contain apostrophes ('
) as well as text resemblingMessageFormat
elements such as{0}
or{data}
. -
Exceptions thrown for files that cannot be deleted when cleaning up a temporary directory created via
@TempDir
now include the root cause. -
Lifecycle methods are allowed to be declared as
private
again for backwards compatibility; however, usingprivate
visibility for lifecycle methods is strongly discouraged and will be disallowed in a future release.
-
The search algorithm used to find
@MethodSource
factory methods now falls back to lenient search semantics when a factory method cannot be found by qualified name (without a parameter list) and also provides better diagnostics when a unique factory method cannot be found.