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.13.0-M3
Date of Release: ❓
Scope: ❓
For a complete list of all closed issues and pull requests for this release, consult the 5.13.0-M3 milestone page in the JUnit repository on GitHub.
5.13.0-M2
Date of Release: March 24, 2025
Scope: Fix regression in 5.13.0-M1
For a complete list of all closed issues and pull requests for this release, consult the 5.13.0-M2 milestone page in the JUnit repository on GitHub.
5.13.0-M1
Date of Release: March 21, 2025
Scope:
-
Introduce
@ClassTemplate
and@ParameterizedClass
support in JUnit Jupiter -
Access to
ParameterInfo
for JUnit Jupiter extensions -
New
@SentenceFragment
annotation for use withIndicativeSentences
display name generator -
Add
--redirect-stdout
and--redirect-stderr
options toConsoleLauncher
-
Introduce test discovery support in
EngineTestKit
-
Bug fixes and other minor improvements
For a complete list of all closed issues and pull requests for this release, consult the 5.13.0-M1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
Notify
LauncherDiscoveryListener
implementation registered viaLaucherConfig
or on theLauncher
ofselectorProcessed
events.
New Features and Improvements
-
New
ConsoleLauncher
options--redirect-stdout
and--redirect-stderr
for redirectingstdout
andstderr
output streams to files. -
Add
TestDescriptor.Visitor.composite(List)
factory method for creating a composite visitor that delegates to the given visitors in order. -
Introduce test discovery support in
EngineTestKit
to ease testing for discovery issues produced by aTestEngine
. Please refer to the User Guide for details. -
This milestone contains preliminary APIs for reporting issues encountered by test engines during test discovery. However, these are still under active development and not yet ready for general use. If you’re a maintainer of a test engine, please wait for the next milestone before adopting these new APIs. If you’re interested, you can follow along our progress in #242.
JUnit Jupiter
Bug Fixes
-
If the
autoCloseArguments
attribute in@ParameterizedTest
is set totrue
, all arguments returned by registeredArgumentsProvider
implementations are now closed even if the test method declares fewer parameters. -
AutoCloseable
arguments returned by anArgumentsProvider
are now closed even if they are wrapped withNamed
. -
AutoCloseable
arguments returned by anArgumentsProvider
are now closed even if a failure happens prior to invoking the parameterized method.
New Features and Improvements
-
New
@ClassTemplate
annotation andClassTemplateInvocationContextProvider
API that allow declaring a top-level or@Nested
test class as a template to be invoked multiple times. This may be used, for example, to inject different parameters to be used by all tests in the class template or to set up each invocation of the class template differently. Please refer to the User Guide for details. -
New
BeforeClassTemplateInvocationCallback
andAfterClassTemplateInvocationCallback
extension callback interfaces allow implementing extensions that are invoked before and after each invocation of a class template. -
New
@ParameterizedClass
support that builds on@ClassTemplate
and allows declaring a top-level or@Nested
test class as a parameterized test class to be invoked multiple times with different arguments. The same@…Source
annotations supported with@ParameterizedTest
may be used to provide arguments via constructor or field injection. Please refer to the User Guide for details. -
New
@ParameterizedClass
-specific@BeforeParameterizedClassInvocation
/@AfterParameterizedClassInvocation
lifecycle methods that are invoked once before/after each invocation of the parameterized class. -
Provide access to the parameters and resolved arguments of a
@ParameterizedTest
or@ParameterizedClass
by storingParameterInfo
in theExtensionContext.Store
for retrieval by other extensions. Please refer to the Javadoc for details. -
New
@SentenceFragment
annotation which allows one to supply custom text for individual sentence fragments when using theIndicativeSentences
DisplayNameGenerator
. See the updated documentation in the User Guide for an example. -
New
TestTemplateInvocationContext.prepareInvocation(ExtensionContext)
callback method which allows extensions to prepare theExtensionContext
before the test template method is invoked. This may be used, for example, to store entries in theExtensionContext.Store
to benefit from its cleanup support or for retrieval by other extensions.
5.12.1
Date of Release: March 14, 2025
Scope: Bug fixes and enhancements since 5.12.0
For a complete list of all closed issues and pull requests for this release, consult the 5.12.1 milestone page in the JUnit repository on GitHub.
5.12.0
Date of Release: February 21, 2025
Scope:
-
Output file attachments for tests and containers
-
Improvements to the Open Test Reporting XML output
-
Resource lock definition improvements
-
Thread dumps on test timeouts
-
Parameterized test validation improvements
-
Filtering support for auto-registered extensions
-
Kotlin contracts for assertions
-
Configurable Jupiter extension context scope
-
Enhancements to the
ConsoleLauncher
-
Better support for GraalVM native image usage
-
Improved discovery support for file-based test engines
-
Customizable classpath scanning
-
Parallel execution support in JUnit Vintage engine
-
Numerous bug fixes and other enhancements
For complete details consult the 5.12.0 Release Notes online.