This document contains the change log for all JUnit 5 releases since 5.9 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.10.0-M1

Date of Release:

Scope:

For a complete list of all closed issues and pull requests for this release, consult the 5.10.0-M1 milestone page in the JUnit repository on GitHub.

JUnit Platform

Bug Fixes

Deprecations and Breaking Changes

  • Building native images with GraalVM now requires configuring the build arg --initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig.

New Features and Improvements

  • All utility methods from ReflectionSupport now have counterparts returning Stream instead of List.

  • For consistency with Jupiter lifecycle callbacks, listener method pairs for started/ finished and opened/closed events are now called using "wrap" semantics, i.e. the latter methods are called in reverse order compared to the former when multiple listeners are registered. This affects the following listener interfaces: TestExecutionListener, EngineExecutionListener, LauncherDiscoveryListener, and LauncherSessionListener.

  • Introduce LauncherInterceptor SPI for intercepting the creation of instances of Launcher and LauncherSessionlistener as well as calls for discover and execute of the former. Please refer to the User Guide for details.

JUnit Jupiter

Bug Fixes

  • Parameter types for local @MethodSource factory method names are now validated. For example, @MethodSource("myFactory(example.NonexistentType)") will now result in an exception stating that example.NonexistentType cannot be resolved to a valid type.

  • The syntax for parameter types in local @MethodSource factory method names now supports canonical array names — for example, you may now specify int[] as in @MethodSource("myFactory(int[])" instead of the binary name [I as in @MethodSource("myFactory([I)" (which was already supported) and @MethodSource("myFactory(java.lang.String[]) instead of @MethodSource("myFactory([Ljava.lang.String;).

Deprecations and Breaking Changes

New Features and Improvements

  • New ArgumentsAccessor.getInvocationIndex() method that supplies the index of a @ParameterizedTest invocation.

  • DisplayNameGenerator methods are now allowed to return null, in order to signal to fall back to the default display name generator.

JUnit Vintage

Bug Fixes

Deprecations and Breaking Changes

New Features and Improvements

5.9.2

Date of Release: January 10, 2023

Scope: Bug fixes and enhancements since 5.9.1

For a complete list of all closed issues and pull requests for this release, consult the 5.9.2 milestone page in the JUnit repository on GitHub.

JUnit Platform

Bug Fixes

  • The Java 7 based constructor for ForkJoinPool is no longer accidentally used on Java 9 or higher when invalid ParallelExecutionConfiguration is provided. Instead, an exception is thrown for invalid configuration, thereby preventing invalid configuration from being silently ignored.

New Features and Improvements

  • New TestPlan.getTestIdentifier(UniqueId) and TestPlan.getChildren(UniqueId) methods to avoid parsing unique IDs unnecessarily during test execution.

  • Support for limiting the max-pool-size for parallel execution via a configuration parameter.

  • Suite discovery now ignores cycles encountered in a test suite and logs an informational message at CONFIG level instead of throwing an exception.

JUnit Jupiter

Bug Fixes

  • New @MethodSource syntax for explicitly selecting an overloaded local factory method without specifying its fully qualified name.

Deprecations and Breaking Changes

  • The fixed parallel execution strategy now allows the thread pool to be saturated by default.

New Features and Improvements

  • JAVA_21 has been added to the JRE enum for use with JRE-based execution conditions.

  • New junit.jupiter.execution.parallel.config.fixed.max-pool-size configuration parameter to set the maximum pool size.

  • New junit.jupiter.execution.parallel.config.fixed.saturate configuration parameter to disable pool saturation.

JUnit Vintage

Bug Fixes

  • Parameterized tests are now properly reported when used in combination with the Enclosed runner.

5.9.1

Date of Release: September 20, 2022

Scope:

  • New @EnabledInNativeImage and @DisabledInNativeImage annotations for testing in GraalVM native images.

  • Minor bug fixes and enhancements since 5.9.0

For a complete list of all closed issues and pull requests for this release, consult the 5.9.1 milestone page in the JUnit repository on GitHub.

JUnit Platform

Bug Fixes

  • ReflectionSupport.findMethods(…​) now returns a distinct set of methods.

  • Execution in GraalVM native images no longer requires --initialize-at-build-time for OpenTestReportGeneratingListener.

JUnit Jupiter

Bug Fixes

  • Headers provided via the value attribute in @CsvSource for a @ParameterizedTest are now properly parsed when the useHeadersInDisplayName attribute is set to true.

  • A @ParameterizedTest method configured with a @MethodSource annotation that references a factory method inherited from multiple interfaces no longer fails with an exception stating that multiple factory methods with the same name were found.

  • A @ParameterizedTest method configured with a @MethodSource annotation that references a factory method whose name is the same as other non-factory methods in the same class no longer fails with an exception stating that multiple factory methods with the same name were found.

  • Assertion failures thrown from methods with applied timeouts using ThreadMode.SEPARATE are now properly reported.

New Features and Improvements

  • New @EnabledInNativeImage and @DisabledInNativeImage annotations for enabling and disabling tests within a GraalVM native image.

JUnit Vintage

No changes.

5.9.0

Date of Release: July 26, 2022

Scope:

  • XML reports in the new Open Test Reporting format

  • Configurable cleanup mode for @TempDir

  • Configurable thread mode for @Timeout

  • Conditional execution based on OS architectures

  • New TestInstancePreConstructCallback extension API

  • Reusable parameter resolution for custom extension methods via ExecutableInvoker

  • Parameter injection for @MethodSource methods

  • New IterationSelector

  • Various improvements to ConsoleLauncher

  • Numerous bug fixes and minor improvements

For complete details consult the 5.9.0 Release Notes online.