This document contains the change log for all JUnit releases since 5.14 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.
6.0.1
Date of Release: October 31, 2025
Scope: Bug fixes and enhancements since 6.0.0
For a complete list of all closed issues and pull requests for this release, consult the 6.0.1 milestone page in the JUnit repository on GitHub.
JUnit Jupiter
Bug Fixes
-
A regression introduced in version 6.0.0 caused an exception when using
@CsvSourceor@CsvFileSourceif thedelimiterordelimiterStringattribute was set to#. This occurred because#was used as the default comment character without an option to change it. To resolve this, a newcommentCharacterattribute has been added to both annotations. Its default value remains#, but it can now be customized to avoid conflicts with other control characters. -
Fix
IllegalAccessErrorthrown when using the Kotlin-specificassertDoesNotThrowassertion. -
Stop reporting discovery issues for synthetic methods, particularly in conjunction with Kotlin suspend functions.
-
Fix support for test methods with the same signature as a package-private methods declared in super classes in different packages.
Deprecations and Breaking Changes
-
Mark
org.junit.jupiter.migrationsupportmodule descriptor as deprecated for removal.
New Features and Improvements
-
The
@CsvSourceand@CsvFileSourceannotations now allow specifying a custom comment character using the newcommentCharacterattribute. -
Improve error message when using
@ParameterizedClasswith field injection and not providing enough arguments. -
Allow calling
TypedArgumentConverterconstructor for@Nullable Ttarget types without having to cast class literals toClass<@Nullable T>.
6.0.0
Date of Release: September 30, 2025
Scope:
-
Java 17 and Kotlin 2.1 baseline
-
Single version number for Platform, Jupiter, and Vintage
-
Use of JSpecify annotations to express nullability
-
Integration of JFR functionality in
junit-platform-launcher -
Removal of
junit-platform-runnerandjunit-platform-jfr -
Deterministic order of
@Nestedclasses -
MethodOrderer.DefaultandClassOrderer.Defaultfor@Nestedclasses -
Inheritance of
@TestMethodOrderby enclosed@Nestedclasses -
Switch to FastCSV library for
@CsvSourceand@CsvFileSource -
Support for using Kotlin
suspendfunctions as test methods -
New
--fail-fastmode for ConsoleLauncher -
Support for cancelling test execution via
CancellationToken -
Removal of various deprecated behaviors and APIs
For a complete list of all closed issues and pull requests for this release, consult the 6.0.0-M1, 6.0.0-M2, 6.0.0-RC1, 6.0.0-RC2, 6.0.0-RC3, and 6.0.0 milestone pages in the JUnit repository on GitHub.
|
Migration Guide
Please refer to the wiki for guidance on upgrading from JUnit 5.x.y to 6.0.0. |
Overall Improvements
Deprecations and Breaking Changes
-
Minimum required Java version is now 17.
-
Minimum required Kotlin version is now 2.2.
-
Platform artifacts now use the same version number as Jupiter and Vintage artifacts.
New Features and Improvements
-
All JUnit modules now use JSpecify nullability annotations to indicate which method parameters, return types, etc. can be
null.
JUnit Platform
Deprecations and Breaking Changes
-
Support for running the
ConsoleLauncherwithout specifying a subcommand has been removed. -
Support for non-conventional
ConsoleLauncheroptions such as--h(rather than-h) or-help(rather than--help) has been removed. -
The
junit-platform-runnermodule which provided the JUnit 4 basedJUnitPlatformrunner has been removed. -
The
junit-platform-jfrmodule which provided custom Java Flight Recorder (JFR) events for test discovery and execution has been removed. The functionality is now available directly in thejunit-platform-launchermodule. -
Support for Maven Surefire/Failsafe versions less than 3.0.0 has been removed.
-
The following deprecated APIs have been removed:
-
ReflectionSupport.loadClass(String)method -
ReflectionUtils.readFieldValue(…)methods -
ReflectionUtils.getMethod(…)method -
BlacklistedExceptionsclass -
PreconditionViolationExceptionclass (fromorg.junit.platform.commons.util) -
ClasspathScanningSupportclass -
ConfigurationParameters.size()method -
MethodSelector.getMethodParameterTypes()method -
NestedMethodSelector.getMethodParameterTypes()method -
ReportEntry()constructor -
SingleTestExecutorclass -
LauncherDiscoveryRequestBuilder()constructor -
LegacyReportingUtilsclass -
TestPlan.add(TestIdentifier),TestPlan.getChildren(String), andTestPlan.getTestIdentifier(String)methods -
@UseTechnicalNamesannotation for suites -
EngineTestKit.execute(String, EngineDiscoveryRequest),EngineTestKit.execute(TestEngine, EngineDiscoveryRequest), andEngineTestKit.Builder.filters(DiscoveryFilter…)methods
-
-
Support for "legacy semantics" for field and method searches that used to be configurable via the
junit.platform.reflection.search.useLegacySemanticssystem property has been removed. JUnit now always adheres to standard Java semantics regarding whether a given field or method is visible or overridden according to the rules of the Java language. -
The type bounds of the following methods have been changed to be more flexible and allow nullable and non-nullable types:
-
ConfigurationParameters.get(String, Function) -
NamespacedHierarchicalStore.getOrComputeIfAbsent(N, K, Function) -
NamespacedHierarchicalStore.getOrComputeIfAbsent(N, K, Function, Class)
-
-
The
junit-platform-suite-commonsmodule has been removed. Its functionality is now integrated directly in thejunit-platform-suitemodule. -
ConversionSupportnow convertsStringtoLocaleusing the IETF BCP 47 language tag format supported by theLocale.forLanguageTag(String)factory method instead of the format used by the deprecatedLocale(String)constructor. -
All
getOrComputeIfAbsent(…)methods inNamespacedHierarchicalStorehave been deprecated in favor of the newcomputeIfAbsent(…)methods. -
Setting an invalid value for one of the following enum-based configuration parameters now causes test discovery to fail:
-
junit.platform.discovery.issue.failure.phase -
junit.platform.discovery.issue.severity.critical
-
-
The methods
findNestedClasses(…)andstreamNestedClasses(…)inReflectionSupportnow return nested classes, which are declared in the same enclosing class or interface, ordered in a deterministic but intentionally nonobvious way. -
Serialization support for
TestIdentifierhas been changed in a backwards-incompatible way in order to simplify the implementation.
New Features and Improvements
-
New
Launcher.execute(LauncherExecutionRequest)API with correspondingLauncherExecutionRequestBuilderto enable the addition of parameters to test executions in the future without additional overloads ofexecute(…). -
New
discoveryRequest()method inLauncherDiscoveryRequestBuilder(analogous toexecutionRequest(…)inLauncherExecutionRequestBuilder), which is an alias for the existingrequest()method and is intended to be used via astaticimport. -
New
LauncherDiscoveryRequestBuilder.forExecution()method which serves as a convenience for constructing aLauncherExecutionRequestthat contains aLauncherDiscoveryRequest. -
New
selectClasses(…)andselectClassesByName(…)factory methods have been introduced inDiscoverySelectorsto simplify use cases where one needs to select multiple individual test classes for theLauncherorEngineTestKit. -
New
selectors(List)builder method forEngineTestKitwhich can be used in conjunction with the newselectClasses(…)andselectClassesByName(…)factory methods inDiscoverySelectors. -
New support for cancelling a running test execution via a
CancellationTokenpassed to theLauncheras part of aLauncherExecutionRequestand from there to all registered test engines. Please refer to the User Guide for details and a usage example. -
Passing the
--fail-fastoption to theexecutesubcommand of theConsoleLaunchernow causes test execution to be cancelled after the first failed test. -
Cancellation support for implementations of
HierarchicalTestEnginesuch as JUnit Jupiter, Spock, and Cucumber. -
Cancellation support for the
@Suitetest engine. -
New
TestTask.getTestDescriptor()method for use inHierarchicalTestExecutorServiceimplementations. -
New
computeIfAbsent(…)methods inNamespacedHierarchicalStoreto simplify working with non-nullable types. -
Convention-based conversion in
ConversionSupportnow supports factory methods and factory constructors that accept a singleCharSequenceargument in addition to the existing support for factories that accept a singleStringargument. -
Non-printable control characters in display names are now replaced with alternative representations. For example,
\nis replaced with<LF>. This applies to all display names in JUnit Jupiter,@SuiteDisplayName, and any other test engines that subclassAbstractTestDescriptor. Please refer to the User Guide for details. -
Stack traces are now pruned up to the test method or lifecycle method.
JUnit Jupiter
Bug Fixes
-
CSV headers are now properly supported with the default display name pattern and the explicit
{argumentsWithNames}display name pattern for parameterized tests that utilize theuseHeadersInDisplayNameflag in@CsvSourceand@CsvFileSource. Specifically, the parameter name is no longer duplicated in the display name when a CSV header is desired instead.
Deprecations and Breaking Changes
-
The following deprecated APIs have been removed:
-
MethodOrderer.Alphanumericclass -
InvocationInterceptor.interceptDynamicTest(Invocation, ExtensionContext)method
-
-
The deprecated
junit.jupiter.tempdir.scopeconfiguration parameter is no longer supported. -
The
JREenum constants forJAVA_8toJAVA_16have been deprecated because they can no longer be used at runtime sinceJAVA_17is the new baseline. Please also manually update any values used with theminVersionandmaxVersionattributes in@EnabledForJreRangeand@DisabledForJreRangeor theversionsattributes in@EnabledOnJreand@DisabledOnJreto ensure that you are no longer declaring version values less than 17. -
@EnabledForJreRangeand@DisabledForJreRangenow useJAVA_17as their defaultminvalue. -
For consistency with test methods,
@Nestedclasses declared in the same enclosing class or interface are now ordered in a deterministic but intentionally nonobvious way. -
The
junit-jupiter-migrationsupportmodule and its contained classes are now deprecated and will be removed in the next major version. -
As a result of migrating from univocity-parsers to FastCSV for
@CsvSourceand@CsvFileSource, root causes and messages of exceptions thrown for malformed CSV input may differ in some cases. While the overall parsing behavior remains consistent, this may affect custom error handling that relies on specific exception types or messages. -
The
lineSeparatorattribute in@CsvFileSourcehas been removed. The line separator is now automatically detected, meaning that any of\r,\n, or\r\nis treated as a line separator. -
Attributes such as
ignoreLeadingAndTrailingWhitespace,nullValues, and others in@CsvSourceand@CsvFileSourcenow apply to header fields as well as to regular fields. -
Extra characters after a closing quote are no longer allowed in
@CsvSourceand@CsvFileSource. For example, if a single quote is used as the quote character, the following CSV value'foo’INVALID,'bar'will now cause an exception to be thrown. This helps ensure that malformed input is not silently accepted or misinterpreted. -
Support for the
junit.jupiter.params.arguments.conversion.locale.formatconfiguration parameter has been removed.Localeconversions are now always performed using the IETF BCP 47 language tag format supported by theLocale.forLanguageTag(String)factory method. -
The return type of the
provideTestTemplateInvocationContexts(ExtensionContext)method in theTestTemplateInvocationContextProviderinterface has been changed fromStream<TestTemplateInvocationContext>toStream<? extends TestTemplateInvocationContext>. -
The type bounds of the following methods have been changed to be more flexible and allow nullable and non-nullable types:
-
ExtensionContext.getConfigurationParameter(String, Function) -
ExtensionContext.getOrComputeIfAbsent(K, Function) -
ExtensionContext.getOrComputeIfAbsent(K, Function, Class)
-
-
All
getOrComputeIfAbsent(…)methods inExtensionContext.Storeare now deprecated in favor of the newcomputeIfAbsent(…)methods. -
Setting an invalid value for one of the following enum-based configuration parameters now causes test discovery or execution to fail:
-
junit.jupiter.execution.parallel.mode.default -
junit.jupiter.execution.parallel.mode.classes.default -
junit.jupiter.execution.timeout.mode -
junit.jupiter.execution.timeout.thread.mode.default -
junit.jupiter.extensions.testinstantiation.extensioncontextscope.default -
junit.jupiter.tempdir.cleanup.mode.default -
junit.jupiter.testinstance.lifecycle.default
-
-
The contracts for
Executableparameters of Kotlin-specificassertTimeoutfunctions have been changed fromcallsInPlace(executable, EXACTLY_ONCE)tocallsInPlace(executable, AT_MOST_ONCE)which might result in compilation errors.
New Features and Improvements
-
Non-printable control characters in display names are now replaced with alternative representations. Please refer to the User Guide for details.
-
For consistency with
@TestClassOrder,@TestMethodOrderannotations specified on a test class are now inherited by its@Nestedinner classes, recursively. -
New
MethodOrderer.DefaultandClassOrderer.Defaulttypes for reverting back to default ordering on a@Nestedclass and its@Nestedinner classes when an enclosing class specifies a different orderer via@TestMethodOrderor@TestClassOrder, respectively. -
The implementation of
@CsvSourceand@CsvFileSourcehas been migrated from the no longer maintained univocity-parsers to FastCSV. This improves the consistency of CSV input handling, especially for malformed entries, and provides better error reporting and overall performance. -
Display names for
@ParameterizedClassand@ParameterizedTestnow consistently style name-value pairs for arguments usingname = valueformatting – for example,fruit = appleinstead offruit=apple. -
Text-based arguments in display names for parameterized tests are now quoted by default. In addition, special characters are escaped within quoted text. Please refer to the User Guide for details.
-
Fallback String-to-Object Conversion for parameterized tests now supports factory methods and factory constructors that accept a single
CharSequenceargument in addition to the existing support for factories that accept a singleStringargument. -
The
Argumentsinterface for parameterized tests is now officially a@FunctionalInterface. -
Kotlin’s
suspendmodifier may now be applied to test and lifecycle methods. -
New
computeIfAbsent(…)methods inExtensionContext.Storeto simplify working with non-nullable types. -
Reason strings supplied to
ConditionEvaluationResultAPIs are now officially declared as@Nullable.
JUnit Vintage
Deprecations and Breaking Changes
-
The JUnit Vintage test engine is now deprecated and will report an INFO level discovery issue if it finds at least one JUnit 4 test class. The deprecation warning is intended to clarify the purpose of the engine: it should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support.
5.14.1
Date of Release: October 31, 2025
Scope: Bug fixes and enhancements since 5.14.0
For a complete list of all closed issues and pull requests for this release, consult the 5.14.1 milestone page in the JUnit repository on GitHub.
5.14.0
Date of Release: September 30, 2025
Scope:
-
Bug fixes and enhancements since 5.13.x
-
Deprecations along with new APIs to ease migration to JUnit 6
For a complete list of all closed issues and pull requests for this release, consult the 5.14.0-RC1 and 5.14.0 milestone pages in the JUnit repository on GitHub.
For complete details consult the 5.14.0 Release Notes online.