Release Notes
This document contains the change log for all JUnit releases since 6.1.0.
6.2.0-M1
Date of Release: ❓
Scope: ❓
For a complete list of all closed issues and pull requests for this release, consult the 6.2.0-M1 milestone page in the JUnit repository on GitHub.
6.1.0
Date of Release: May 17, 2026
Scope:
-
New
@DefaultLocaleand@DefaultTimeZonebuilt-in extensions -
New built-in extension for clearing/setting/restoring system properties
-
Configurable deletion strategy for
@TempDirthat allows ignoring failures -
New
org.junit.startmodule for usage in compact source files -
Execution mode configuration support for dynamic tests and containers
-
Improved stack trace pruning for assertion failures
-
New
org.junit.jupiter.api.Constantsclass for referencing configuration parameters -
Improvements to legacy XML reports for parameterized test classes
-
New parallel test executor implementation
-
New experimental memory cleanup mode for large test suites
For a complete list of all closed issues and pull requests for this release, consult the 6.1.0 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
A deadlock issue in
NamespacedHierarchicalStore.computeIfAbsent(N, K, Function)has been fixed. -
WorkerThreadPoolHierarchicalTestExecutorServicenow rechecks the done condition before rejecting an extraneous worker. -
Missing precondition checks have been added to
Launcherimplementations. -
Failures to resolve selectors are now propagated by the Suite Engine.
-
AbstractTestDescriptor.getChildren()now returns immutable set of children rather than a merely unmodifiable set.
Deprecations and Breaking Changes
-
Deprecate constructors for
ForkJoinPoolHierarchicalTestExecutorServicein favor of the newParallelHierarchicalTestExecutorServiceFactorythat also supportsWorkerThreadPoolHierarchicalTestExecutorService. -
In the
EngineTestKit,Executions.started()has been deprecated in favor ofExecutions.finished(), since started executions are always finished.
New Features and Improvements
-
Support for creating a
ModuleSelectorfrom ajava.lang.Moduleand using its classloader for test discovery. -
New
selectClasspathResources(String…)andselectClasspathResources(List<String)methods inDiscoverySelectors. -
OpenTestReportGeneratingListenernow supports redirecting XML events to a socket via the newjunit.platform.reporting.open.xml.socketconfiguration parameter. When set to a port number, events are sent to127.0.0.1:<port>instead of being written to a file. -
New
WorkerThreadPoolHierarchicalTestExecutorServiceimplementation used for parallel test execution that is backed by a regular thread pool rather than aForkJoinPool. Engine authors should switch to useParallelHierarchicalTestExecutorServiceFactoryrather than instantiating a concreteHierarchicalTestExecutorServiceimplementation for parallel execution directly. -
New experimental memory cleanup mode that is useful when executing a large number of tests. It can be enabled via the new
junit.platform.execution.memory.cleanup.enabledconfiguration parameter. -
Allow implementations of
HierarchicalTestEngineto specify which nodes require the global read lock by overriding theNode.isGlobalReadLockRequired()method to returnfalse. -
TestDescriptorimplementation requirements have now been clarified in the corresponding Javadoc. -
The
UniqueId.uniqueIdFormatfield has been removed, reducing the size ofUniqueIdobjects.
JUnit Jupiter
Bug Fixes
-
Recursive updates are now supported when using
computeIfAbsent(K, Function, Class)in theExtensionContext.Store, providing parity with the deprecatedgetOrComputeIfAbsent(K, Function, Class)method. -
Legacy XML reports now include the index of
@ClassTemplate/@ParameterizedClassinvocations in test names to make them unique. -
Legacy XML reports now include parent display names to make it easier to distinguish between invocations for different parameters.
Deprecations and Breaking Changes
-
The
OTHERconstant ofJREhas been deprecated in favor of theint/int[]annotation attributes of@EnabledOnJre,@DisabledOnJre,@EnabledForJreRange, and@DisabledForJreRangewhich allow referencing JRE versions later than those supported by theJREenum. -
The
org.junit.jupiter.engine.Constantsclass and its constants are now deprecated in favor oforg.junit.jupiter.api.Constants.
New Features and Improvements
-
JUnit Pioneer's
DefaultLocaleExtensionandDefaultTimeZoneExtensionare now part of JUnit Jupiter. Find examples in the User Guide. -
JUnit Pioneer’s
SystemPropertyExtensionis now part of JUnit Jupiter. Find examples in the User Guide. For details regarding implementation differences between JUnit Pioneer and Jupiter, see the corresponding pull request. -
@TempDirnow allows configuring a deletion strategy for temporary directories. This is typically used to gain control over what happens when deletion of a file or directory fails (see User Guide for details). -
JAVA_27has been added to theJREenum for use withJRE-based execution conditions. -
Introduce new module
org.junit.startfor writing and running tests. It simplifies using JUnit in compact source files together with a singlemodule importstatement. Find an example at the User Guide. -
Argumentsmay now be created from instances ofIterablevia the following new methods which make it easier to dynamically build arguments from collections when using@ParameterizedTest.-
Arguments.of(Iterable<?>) -
Arguments.argumentsFrom(Iterable<?>)(alias forof(Iterable<?>)) -
Arguments.argumentSetFrom(String, Iterable<?>) -
Arguments.toList()— returns a mutableList<@Nullable Object>
-
-
@EmptySourcenow supportsIterable,Iterator, andListIterator. -
@Deprecatedfactory methods are now excluded in the fallback String-to-Object conversion algorithm. -
Introduce new
dynamicTest(Consumer<? super Configuration>)factory method for dynamic tests. It allows configuring theExecutionModeof the dynamic test in addition to its display name, test source URI, and executable. -
Introduce new
dynamicContainer(Consumer<? super Configuration>)factory method for dynamic containers. It allows configuring theExecutionModeof the dynamic container and/or its children in addition to its display name, test source URI, and children. -
Enrich
assertInstanceOffailure using the test subjectThrowableas cause. It results in the stack trace of the test subjectThrowableto get reported along with the failure. -
Make implementation of
HierarchicalTestExecutorServiceused for parallel test execution configurable via the newjunit.jupiter.execution.parallel.config.executor-serviceconfiguration parameter to in order to add support forWorkerThreadPoolHierarchicalTestExecutorService. Please refer to the User Guide for details. -
Internal stack frames are now removed from
AssertionFailedErrorstack traces. -
New
trimStacktrace(Class<?>)andretainStackTraceElements(int)methods inAssertionFailureBuilderwhich allow user-defined assertions to trim their stack traces. -
Generic inline value classes (such as
kotlin.Result<T>) can now be used as parameters in@ParameterizedTestmethods whenkotlin-reflectis on the classpath. Note, however, that primitive-wrapper inline value classes (such asUIntor custom value classes wrapping primitives) are not yet supported. -
Kotlin-specific assertions now include a variant of
assertThrowsExactlywith reified generics. -
The new
org.junit.jupiter.api.Constantsclass provides constants for Configuration Parameters specific to the Jupiter engine. -
The
@EmptySourceannotation now provides atypeattribute that allows configuring the type of the empty argument explicitly. This is intended to be used in conjunction with anArgumentConverterthat supports the specified type.