Release Notes

This version is still in development and not considered stable yet.
For the latest stable release, please see JUnit 6.0.3!

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.

JUnit Platform

Bug Fixes

Deprecations and Breaking Changes

New Features and Improvements

JUnit Jupiter

Bug Fixes

Deprecations and Breaking Changes

New Features and Improvements

JUnit Vintage

Bug Fixes

Deprecations and Breaking Changes

New Features and Improvements

6.1.0

Date of Release: May 17, 2026

Scope:

  • New @DefaultLocale and @DefaultTimeZone built-in extensions

  • New built-in extension for clearing/setting/restoring system properties

  • Configurable deletion strategy for @TempDir that allows ignoring failures

  • New org.junit.start module 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.Constants class 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.

  • WorkerThreadPoolHierarchicalTestExecutorService now rechecks the done condition before rejecting an extraneous worker.

  • Missing precondition checks have been added to Launcher implementations.

  • 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 ForkJoinPoolHierarchicalTestExecutorService in favor of the new ParallelHierarchicalTestExecutorServiceFactory that also supports WorkerThreadPoolHierarchicalTestExecutorService.

  • In the EngineTestKit, Executions.started() has been deprecated in favor of Executions.finished(), since started executions are always finished.

New Features and Improvements

  • Support for creating a ModuleSelector from a java.lang.Module and using its classloader for test discovery.

  • New selectClasspathResources(String…​) and selectClasspathResources(List<String) methods in DiscoverySelectors.

  • OpenTestReportGeneratingListener now supports redirecting XML events to a socket via the new junit.platform.reporting.open.xml.socket configuration parameter. When set to a port number, events are sent to 127.0.0.1:<port> instead of being written to a file.

  • New WorkerThreadPoolHierarchicalTestExecutorService implementation used for parallel test execution that is backed by a regular thread pool rather than a ForkJoinPool. Engine authors should switch to use ParallelHierarchicalTestExecutorServiceFactory rather than instantiating a concrete HierarchicalTestExecutorService implementation 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.enabled configuration parameter.

  • Allow implementations of HierarchicalTestEngine to specify which nodes require the global read lock by overriding the Node.isGlobalReadLockRequired() method to return false.

  • TestDescriptor implementation requirements have now been clarified in the corresponding Javadoc.

  • The UniqueId.uniqueIdFormat field has been removed, reducing the size of UniqueId objects.

JUnit Jupiter

Bug Fixes

  • Recursive updates are now supported when using computeIfAbsent(K, Function, Class) in the ExtensionContext.Store, providing parity with the deprecated getOrComputeIfAbsent(K, Function, Class) method.

  • Legacy XML reports now include the index of @ClassTemplate/@ParameterizedClass invocations 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 OTHER constant of JRE has been deprecated in favor of the int/int[] annotation attributes of @EnabledOnJre, @DisabledOnJre, @EnabledForJreRange, and @DisabledForJreRange which allow referencing JRE versions later than those supported by the JRE enum.

  • The org.junit.jupiter.engine.Constants class and its constants are now deprecated in favor of org.junit.jupiter.api.Constants.

New Features and Improvements

  • JUnit Pioneer's DefaultLocaleExtension and DefaultTimeZoneExtension are now part of JUnit Jupiter. Find examples in the User Guide.

  • JUnit Pioneer’s SystemPropertyExtension is 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.

  • @TempDir now 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_27 has been added to the JRE enum for use with JRE-based execution conditions.

  • Introduce new module org.junit.start for writing and running tests. It simplifies using JUnit in compact source files together with a single module import statement. Find an example at the User Guide.

  • Arguments may now be created from instances of Iterable via the following new methods which make it easier to dynamically build arguments from collections when using @ParameterizedTest.

    • Arguments.of(Iterable<?>)

    • Arguments.argumentsFrom(Iterable<?>) (alias for of(Iterable<?>))

    • Arguments.argumentSetFrom(String, Iterable<?>)

    • Arguments.toList() — returns a mutable List<@Nullable Object>

  • @EmptySource now supports Iterable, Iterator, and ListIterator.

  • @Deprecated factory 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 the ExecutionMode of 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 the ExecutionMode of the dynamic container and/or its children in addition to its display name, test source URI, and children.

  • Enrich assertInstanceOf failure using the test subject Throwable as cause. It results in the stack trace of the test subject Throwable to get reported along with the failure.

  • Make implementation of HierarchicalTestExecutorService used for parallel test execution configurable via the new junit.jupiter.execution.parallel.config.executor-service configuration parameter to in order to add support for WorkerThreadPoolHierarchicalTestExecutorService. Please refer to the User Guide for details.

  • Internal stack frames are now removed from AssertionFailedError stack traces.

  • New trimStacktrace(Class<?>) and retainStackTraceElements(int) methods in AssertionFailureBuilder which 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 @ParameterizedTest methods when kotlin-reflect is on the classpath. Note, however, that primitive-wrapper inline value classes (such as UInt or custom value classes wrapping primitives) are not yet supported.

  • Kotlin-specific assertions now include a variant of assertThrowsExactly with reified generics.

  • The new org.junit.jupiter.api.Constants class provides constants for Configuration Parameters specific to the Jupiter engine.

  • The @EmptySource annotation now provides a type attribute that allows configuring the type of the empty argument explicitly. This is intended to be used in conjunction with an ArgumentConverter that supports the specified type.

JUnit Vintage

No changes.