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

Date of Release:

Scope:

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

JUnit Platform

Bug Fixes

Deprecations and Breaking Changes

  • The JUnit Platform Surefire Provider (junit-platform-surefire-provider) has been discontinued and is no longer released as part of JUnit 5. Please use Maven Surefire’s native support for running tests on the JUnit Platform instead (requires Maven Surefire 2.22.0 or higher).

New Features and Improvements

  • New ModifierSupport class providing an API for extension and test engine authors to inspect modifiers of classes and members.

JUnit Jupiter

Bug Fixes

  • Assertions.assertAll() is now thread-safe — for example, it can now be used with a parallel Stream.

  • The OS.SOLARIS enum constant used with @EnabledOnOs and @DisabledOnOs is now also detected as the current operating system if the os.name JVM system property contains "SunOs".

  • Assertions.assertEquals() variants that compare floating point numbers using a delta now support a delta of zero.

  • Assertions.assertLinesMatch() no longer throws a NullPointerException after evaluating a fast-forward match if there are more expected lines after the fast-forward match than remain in the actual results. This bug only manifested itself if the expected list size was equal to or greater than the actual list size.

Deprecations and Breaking Changes

New Features and Improvements

  • New Assertions.assertEquals() variants that accept mixed boxed and unboxed primitive values, allowing statements such as assertEquals(42, Integer.valueOf("42")) to compile.

  • New Assertions.assertNotEquals() variants that accept the following primitive data types: char, byte, short, int, long, float, and double. Mixed boxed and unboxed primitive values are also supported.

  • JUnit 4’s AssumptionViolatedException is now supported in JUnit Jupiter for aborting a test mid-flight due to a failed assumption — for example, via JUnit 4’s org.junit.Assume utility class.

  • In addition to returning streams, @TestFactory-annotated methods may now return a single DynamicNode — for example, a DynamicTest or a DynamicContainer.

  • Implicit conversion from hexadecimal and octal string representations to integral types in @ParameterizedTest arguments — for example, conversion from "0xff" to 255.

  • New DisplayNameGenerator interface and @DisplayNameGeneration annotation that allow declarative configuration of a pre-defined or custom display name generator.

  • JUnit 4’s @Ignore annotation is now supported for disabling test classes and test methods via the junit-jupiter-migrationsupport module.

JUnit Vintage

Bug Fixes

Deprecations and Breaking Changes

New Features and Improvements

5.3.1

Date of Release: September 11, 2018

Scope: Bug fixes since 5.3.0

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

JUnit Platform

Bug Fixes

  • An OutOfMemoryError regression introduced in JUnit 5.3.0 has been fixed.

    • Specifically, the NodeTestTask used by implementations of HierarchicalTestEngine (such as the Jupiter and Vintage test engines) no longer retains references to contextual state after a node has completed execution. This allows state such as instances of test classes to be properly garbage collected by the JVM.

    • Previously, a NodeTestTask instance was created for each TestDescriptor before starting execution. Now they are created on the fly and can be garbage collected by the JVM after the enclosing container has finished.

  • The OpenTest4J dependency has been updated to 1.1.1 to fix a serialization incompatibility between 1.0.0 and 1.1.0 that caused failure messages to be discarded when used from Gradle and potentially other tools and IDEs.

JUnit Jupiter

Bug Fixes

  • Invocations of assertThrows() that are passed a method reference for an overloaded method with a void return type once again compile.

    • For example, given an instance of java.lang.Object stored in a variable named object, assertThrows(Exception.class, object::wait) compiled against JUnit 5.2.0, failed to compile against JUnit 5.3.0, but now compiles against JUnit 5.3.1.

Breaking Changes

  • In order to revert the aforementioned breaking change, variants of assertThrows() introduced in JUnit 5.3.0 that accept ThrowingSupplier arguments have been removed.

JUnit Vintage

No changes

5.3.0

Date of Release: September 3, 2018

Scope: Parallel test execution, output capture for System.out and System.err, new TestInstanceFactory extension API, custom test sources for dynamic tests, promotion of the dynamic test API from experimental to maintained status, discontinuation of the junit-platform-gradle-plugin, deprecation of the junit-platform-surefire-provider, as well as various minor improvements and bug fixes.

For complete details consult the 5.3.0 Release Notes online.