API Evolution

There is a newer version available.
For the latest stable release, please see JUnit 6.1.3!

One of the major goals of the JUnit Platform architecture is to improve maintainers' capabilities to evolve JUnit despite its being used in many projects. With JUnit 4 a lot of stuff that was originally added as an internal construct only got used by external extension writers and tool builders. That made changing JUnit 4 especially difficult and sometimes impossible.

That’s why JUnit now uses a defined lifecycle for all publicly available interfaces, classes, and methods.

API Version and Status

Every published artifact has a version number <major>.<minor>.<patch>, and all publicly available interfaces, classes, and methods are annotated with @API from the @API Guardian project. The annotation’s status attribute can be assigned one of the following values.

Status Description

INTERNAL

Must not be used by any code other than JUnit itself. Might be removed without prior notice.

DEPRECATED

Should no longer be used; might disappear in the next minor release.

EXPERIMENTAL

Intended for new, experimental features where we are looking for feedback.
Use this element with caution; it might be promoted to MAINTAINED or STABLE in the future, but might also be removed without prior notice, even in a patch.

MAINTAINED

Intended for features that will not be changed in a backwards- incompatible way for at least the next minor release of the current major version. If scheduled for removal, it will be demoted to DEPRECATED first.

STABLE

Intended for features that will not be changed in a backwards- incompatible way in the current major version (6.*).

If the @API annotation is present on a type, it is considered to be applicable for all public members of that type as well. A member is allowed to declare a different status value of lower stability.

Experimental APIs

The following tables list which APIs are currently designated as experimental via @API(status = EXPERIMENTAL). Caution should be taken when relying on such APIs.

Module org.junit.jupiter.api

Package org.junit.jupiter.api

Name Since

AssertionFailureBuilder.​retainStackTraceElements(int) (method)

6.1

AssertionFailureBuilder.​trimStacktrace(@Nullable Class<?>) (method)

6.1

ClassOrderer.​Default (class)

6.0

@ClassTemplate (annotation)

6.0

@DisplayNameGenerator.​IndicativeSentences.​SentenceFragment (annotation)

6.0

DynamicContainer.​Configuration (interface)

6.1

DynamicContainer.​dynamicContainer(Consumer<? super Configuration>) (method)

6.1

DynamicContainer.​getChildExecutionMode() (method)

6.1

DynamicNode.​Configuration (interface)

6.1

DynamicNode.​getExecutionMode() (method)

6.1

DynamicTest.​Configuration (interface)

6.1

DynamicTest.​dynamicTest(Consumer<? super Configuration>) (method)

6.1

MethodOrderer.​Default (class)

6.0

Package org.junit.jupiter.api.extension

Name Since

AfterClassTemplateInvocationCallback (interface)

6.0

BeforeClassTemplateInvocationCallback (interface)

6.0

ClassTemplateInvocationContext (interface)

6.0

ClassTemplateInvocationContextProvider (interface)

6.0

ExtensionContext.​StoreScope (enum)

6.0

ExtensionContext.​getStore(StoreScope, Namespace) (method)

6.0

TemplateInvocationValidationException (class)

6.0

TestTemplateInvocationContext.​prepareInvocation(ExtensionContext) (method)

6.0

Package org.junit.jupiter.api.io

Name Since

@TempDir(deletionStrategy=.​.​.​) (annotation attribute)

6.1

TempDirDeletionStrategy (interface)

6.1

Package org.junit.jupiter.api.util

Name Since

@ClearSystemProperty (annotation)

6.1

@ClearSystemProperty.​ClearSystemProperties (annotation)

6.1

@ReadsSystemProperty (annotation)

6.1

@RestoreSystemProperties (annotation)

6.1

@SetSystemProperty (annotation)

6.1

@SetSystemProperty.​SetSystemProperties (annotation)

6.1

@WritesSystemProperty (annotation)

6.1

Module org.junit.jupiter.params

Package org.junit.jupiter.params

Name Since

@AfterParameterizedClassInvocation (annotation)

6.0

@BeforeParameterizedClassInvocation (annotation)

6.0

@Parameter (annotation)

6.0

ParameterInfo (interface)

5.14

@ParameterizedClass (annotation)

6.0

@ParameterizedTest(quoteTextArguments=.​.​.​) (annotation attribute)

6.0

Package org.junit.jupiter.params.aggregator

Name Since

ArgumentsAggregator.​aggregateArguments(ArgumentsAccessor, FieldContext) (method)

6.0

SimpleArgumentsAggregator (class)

6.0

Package org.junit.jupiter.params.converter

Name Since

ArgumentConverter.​convert(@Nullable Object, FieldContext) (method)

6.0

Package org.junit.jupiter.params.provider

Name Since

Arguments.​argumentSetFrom(String, Iterable<? extends @Nullable Object>) (method)

6.1

Arguments.​argumentsFrom(Iterable<? extends @Nullable Object>) (method)

6.1