API Evolution
One of the major goals of JUnit 5 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 5 introduces 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 |
|---|---|
|
Must not be used by any code other than JUnit itself. Might be removed without prior notice. |
|
Should no longer be used; might disappear in the next minor release. |
|
Intended for new, experimental features where we are looking for feedback. |
|
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 |
|
Intended for features that will not be changed in a backwards-
incompatible way in the current major version ( |
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
Deprecated APIs
The following tables list which APIs are currently designated as deprecated via
@API(status = DEPRECATED). You should avoid using deprecated APIs whenever possible,
since such APIs will likely be removed in an upcoming release.
Module org.junit.jupiter.api
Package org.junit.jupiter.api
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
|
|
Package org.junit.jupiter.api.condition
| Name | Since |
|---|---|
|
|
Package org.junit.jupiter.api.extension
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
Module org.junit.jupiter.params
Module org.junit.platform.commons
Package org.junit.platform.commons.support
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module org.junit.platform.engine
Package org.junit.platform.engine
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
|
|
Package org.junit.platform.engine.discovery
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
Package org.junit.platform.engine.reporting
| Name | Since |
|---|---|
|
|
|
|
Module org.junit.platform.launcher
Package org.junit.platform.launcher
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
Module org.junit.platform.testkit
Package org.junit.platform.testkit.engine
| Name | Since |
|---|---|
|
|
|
|
|
|
|
|
@API Tooling Support
The @API Guardian project plans to provide tooling support for publishers and consumers
of APIs annotated with @API. For example, the tooling support will likely provide a
means to check if JUnit APIs are being used in accordance with @API annotation
declarations.