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-M1
Date of Release: March 21, 2025
Scope:
-
Introduce
@ClassTemplateand@ParameterizedClasssupport in JUnit Jupiter -
Access to
ParameterInfofor JUnit Jupiter extensions -
New
@SentenceFragmentannotation for use withIndicativeSentencesdisplay name generator -
Add
--redirect-stdoutand--redirect-stderroptions 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
LauncherDiscoveryListenerimplementation registered viaLaucherConfigor on theLauncherofselectorProcessedevents.
New Features and Improvements
-
New
ConsoleLauncheroptions--redirect-stdoutand--redirect-stderrfor redirectingstdoutandstderroutput 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
EngineTestKitto 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
autoCloseArgumentsattribute in@ParameterizedTestis set totrue, all arguments returned by registeredArgumentsProviderimplementations are now closed even if the test method declares fewer parameters. -
AutoCloseablearguments returned by anArgumentsProviderare now closed even if they are wrapped withNamed. -
AutoCloseablearguments returned by anArgumentsProviderare now closed even if a failure happens prior to invoking the parameterized method.
New Features and Improvements
-
New
@ClassTemplateannotation andClassTemplateInvocationContextProviderAPI that allow declaring a top-level or@Nestedtest 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
BeforeClassTemplateInvocationCallbackandAfterClassTemplateInvocationCallbackextension callback interfaces allow implementing extensions that are invoked before and after each invocation of a class template. -
New
@ParameterizedClasssupport that builds on@ClassTemplateand allows declaring a top-level or@Nestedtest class as a parameterized test class to be invoked multiple times with different arguments. The same@…Sourceannotations supported with@ParameterizedTestmay be used to provide arguments via constructor or field injection. Please refer to the User Guide for details. -
New
@ParameterizedClass-specific@BeforeParameterizedClassInvocation/@AfterParameterizedClassInvocationlifecycle methods that are invoked once before/after each invocation of the parameterized class. -
Provide access to the parameters and resolved arguments of a
@ParameterizedTestor@ParameterizedClassby storingParameterInfoin theExtensionContext.Storefor retrieval by other extensions. Please refer to the Javadoc for details. -
New
@SentenceFragmentannotation which allows one to supply custom text for individual sentence fragments when using theIndicativeSentencesDisplayNameGenerator. See the updated documentation in the User Guide for an example. -
New
TestTemplateInvocationContext.prepareInvocation(ExtensionContext)callback method which allows extensions to prepare theExtensionContextbefore the test template method is invoked. This may be used, for example, to store entries in theExtensionContext.Storeto 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.