This document contains the change log for all JUnit 5 releases since 5.1 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.2.0-RC1
Date of Release: April 22, 2018
Scope: Improvements to User Guide and Javadoc
For a complete list of all closed issues and pull requests for this release, consult the 5.2 RC1 milestone page in the JUnit repository on GitHub.
5.2.0-M1
Date of Release: April 15, 2018
Scope: JUnit BOM, support for Maven Surefire 2.21.0 allowing builds with Java 9 and
Java 10, argument aggregation and widening primitive conversion for arguments in
parameterized tests, external factory methods for @MethodSource
, as well as various
minor improvements and bug fixes.
For a complete list of all closed issues and pull requests for this release, consult the 5.2 M1 milestone page in the JUnit repository on GitHub.
JUnit Platform
Bug Fixes
-
Tag expressions containing spaces are now supported in the JUnit Platform Maven Surefire provider.
-
Duplicate
--config
keys supplied to theConsoleLauncher
are now reported properly. -
Exceptions thrown in
Node.after()
(in theHierarchicalTestEngine
infrastructure) no longer mask earlier exceptions.
New Features and Improvements
-
The JUnit Platform Surefire Provider (
junit-platform-surefire-provider
) now works with and requires Surefire2.21.0
which allows it to be used with Java 9 and Java 10. -
The default include pattern for filtering class names now matches test classes whose names either start with
Test
or end withTest
orTests
.-
This pattern is used by the
ConsoleLauncher
, the JUnit Platform Gradle Plugin, and theJUnitPlatform
runner.
-
JUnit Jupiter
Bug Fixes
-
Exceptions thrown by an
AfterAllCallback
no longer mask exceptions thrown at the class level when using the@TestInstance(PER_CLASS)
lifecycle mode.
New Features and Improvements
-
New
assertDoesNotThrow()
methods inAssertions
which assert that the execution of a given code block does not throw any kind of exception. -
New
fail()
method inAssertions
makes it possible to fail a test without an explicit failure message. -
Implicit support for widening primitive conversion for an argument supplied to a
@ParameterizedTest
.-
For example, a parameterized test annotated with
@ValueSource(ints = { 1, 2, 3 })
can be declared to accept an argument of typeint
,long
,float
, ordouble
.
-
-
@MethodSource
now supportsstatic
factory methods declared in external classes referenced by fully qualified method name. -
Support for aggregation of multiple
@ParameterizedTest
arguments into a single object.-
For details, see Argument Aggregation.
-
5.1.1
Date of Release: April 8, 2018
Scope: Bug fixes and minor improvements since the 5.1.0 release
For a complete list of all closed issues and pull requests for this release, consult the 5.1.1 milestone page in the JUnit repository on GitHub.
JUnit Jupiter
New Features and Improvements
-
The
ParameterContext
API used inParameterResolver
implementations now includes the following convenience methods for looking up annotations on parameters. Extension authors are strongly encouraged to use these methods instead of those provided in the corejava.lang.reflect.Parameter
API due to a bug injavac
on JDK versions prior to JDK 9 which causes lookups for annotations on parameters in inner class constructors to fail consistently — for example, when resolving a parameter for a@Nested
test class constructor.-
boolean isAnnotated(Class<? extends Annotation> annotationType)
-
Optional<A> findAnnotation(Class<A> annotationType)
-
List<A> findRepeatableAnnotations(Class<A> annotationType)
-
5.1.0
Date of Release: February 18, 2018
Scope:
-
Discovering tests in Java 9 modules
-
Improved Kotlin support
-
Tag expression language for filtering tests to be executed
-
Annotation-based conditional test execution with support for environment variables, system properties, operating systems, JRE versions, and dynamic scripts
-
Various improvements for writing parameterized tests
-
Refinements to the
ExtensionContext
API -
Support for re-running individual dynamic tests, parameterized tests, and test template invocations within an IDE
For complete details consult the 5.1.0 Release Notes online.