Top Description
org.junit.jupiter.api.extension

public Interface Extension

Known Direct Subinterfaces
org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.LifecycleMethodExecutionExceptionHandler, org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.TestExecutionExceptionHandler, org.junit.jupiter.api.extension.TestInstanceFactory, org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.TestInstancePreConstructCallback, org.junit.jupiter.api.extension.TestInstancePreDestroyCallback, org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider, org.junit.jupiter.api.extension.TestWatcher, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.BeforeTestExecutionCallback, org.junit.jupiter.api.extension.ExecutionCondition
Annotations
@API
status:STABLE
since:5.0
Static Imports
org.apiguardian.api.API.Status.STABLE

Marker interface for all extensions.

An Extension can be registered declaratively via @ExtendWith, programmatically via @RegisterExtension, or automatically via the java.util.ServiceLoader mechanism. For details on the latter, consult the User Guide.

Constructor Requirements

Extension implementations must have a default constructor if registered via @ExtendWith or the ServiceLoader. When registered via @ExtendWith the default constructor is not required to be public. When registered via the ServiceLoader the default constructor must be public. When registered via @RegisterExtension the extension's constructors typically must be public unless the extension provides static factory methods or a builder API as an alternative to constructors.

Since
5.0