Uses of Interface
org.junit.jupiter.api.extension.ExtensionContext
Packages that use ExtensionContext
Package
Description
JUnit Jupiter API for writing extensions.
JUnit Jupiter API support for writing extensions.
IO-related support in JUnit Jupiter.
Test descriptors used within the JUnit Jupiter test engine.
Internal classes for test execution within the JUnit Jupiter test engine.
Test extensions specific to the JUnit Jupiter test engine.
Extensions which provide support for conditional test execution features of
JUnit 4 (e.g., the
@Ignore
annotation) within JUnit
Jupiter.Extensions which provide (limited) support for JUnit 4 rules within JUnit Jupiter.
ArgumentConverter
implementations and the corresponding
@ConvertWith
annotation.ArgumentsProvider
implementations and their corresponding
ArgumentsSource
annotations.Support classes for building
providers
and
converters
for arguments.
-
Uses of ExtensionContext in org.junit.jupiter.api.extension
Methods in org.junit.jupiter.api.extension that return ExtensionContextMethods in org.junit.jupiter.api.extension that return types with arguments of type ExtensionContextModifier and TypeMethodDescriptionExtensionContext.getParent()
Get the parent extension context, if available.Methods in org.junit.jupiter.api.extension with parameters of type ExtensionContextModifier and TypeMethodDescriptionvoid
AfterAllCallback.afterAll
(ExtensionContext context) Callback that is invoked once after all tests in the current container.void
AfterClassTemplateInvocationCallback.afterClassTemplateInvocation
(ExtensionContext context) Callback that is invoked after each invocation of a container template.void
AfterEachCallback.afterEach
(ExtensionContext context) Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.void
AfterTestExecutionCallback.afterTestExecution
(ExtensionContext context) Callback that is invoked immediately after an individual test has been executed but before any user-defined teardown methods have been executed for that test.void
BeforeAllCallback.beforeAll
(ExtensionContext context) Callback that is invoked once before all tests in the current container.void
BeforeClassTemplateInvocationCallback.beforeClassTemplateInvocation
(ExtensionContext context) Callback that is invoked before each invocation of a container template.void
BeforeEachCallback.beforeEach
(ExtensionContext context) Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.void
BeforeTestExecutionCallback.beforeTestExecution
(ExtensionContext context) Callback that is invoked immediately before an individual test is executed but after any user-defined setup methods have been executed for that test.void
PreInterruptCallback.beforeThreadInterrupt
(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) Callback that is invoked before aThread
is interrupted withThread.interrupt()
.TestInstanceFactory.createTestInstance
(TestInstanceFactoryContext factoryContext, ExtensionContext extensionContext) Callback for creating a test instance for the supplied context.ExecutionCondition.evaluateExecutionCondition
(ExtensionContext context) Evaluate this condition for the suppliedExtensionContext
.TestInstantiationAwareExtension.getTestInstantiationExtensionContextScope
(ExtensionContext rootContext) Whether this extension should receive a test-scopedExtensionContext
during the instantiation of test instances.default void
LifecycleMethodExecutionExceptionHandler.handleAfterAllMethodExecutionException
(ExtensionContext context, Throwable throwable) Handle the suppliedThrowable
that was thrown during execution of a@AfterAll
lifecycle method.default void
LifecycleMethodExecutionExceptionHandler.handleAfterEachMethodExecutionException
(ExtensionContext context, Throwable throwable) Handle the suppliedThrowable
that was thrown during execution of a@AfterEach
lifecycle method.default void
LifecycleMethodExecutionExceptionHandler.handleBeforeAllMethodExecutionException
(ExtensionContext context, Throwable throwable) Handle the suppliedThrowable
that was thrown during execution of a@BeforeAll
lifecycle method.default void
LifecycleMethodExecutionExceptionHandler.handleBeforeEachMethodExecutionException
(ExtensionContext context, Throwable throwable) Handle the suppliedThrowable
that was thrown during execution of a@BeforeEach
lifecycle method.void
TestExecutionExceptionHandler.handleTestExecutionException
(ExtensionContext context, Throwable throwable) Handle the suppliedthrowable
.default void
InvocationInterceptor.interceptAfterAllMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of an@AfterAll
method.default void
InvocationInterceptor.interceptAfterEachMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of an@AfterEach
method.default void
InvocationInterceptor.interceptBeforeAllMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@BeforeAll
method.default void
InvocationInterceptor.interceptBeforeEachMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@BeforeEach
method.default void
InvocationInterceptor.interceptDynamicTest
(InvocationInterceptor.Invocation<Void> invocation, DynamicTestInvocationContext invocationContext, ExtensionContext extensionContext) Intercept the invocation of aDynamicTest
.default void
InvocationInterceptor.interceptDynamicTest
(InvocationInterceptor.Invocation<Void> invocation, ExtensionContext extensionContext) Deprecated.default <T> T
InvocationInterceptor.interceptTestClassConstructor
(InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<Constructor<T>> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a test class constructor.default <T> T
InvocationInterceptor.interceptTestFactoryMethod
(InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@TestFactory
method, such as a@RepeatedTest
or@ParameterizedTest
method.default void
InvocationInterceptor.interceptTestMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@Test
method.default void
InvocationInterceptor.interceptTestTemplateMethod
(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@TestTemplate
method.default boolean
ClassTemplateInvocationContextProvider.mayReturnZeroClassTemplateInvocationContexts
(ExtensionContext context) Signal that this provider may provide zero invocation contexts for the class template represented by the suppliedcontext
.default boolean
TestTemplateInvocationContextProvider.mayReturnZeroTestTemplateInvocationContexts
(ExtensionContext context) Signal that this provider may provide zero invocation contexts for the test template method represented by the suppliedcontext
.void
TestInstancePostProcessor.postProcessTestInstance
(Object testInstance, ExtensionContext context) Callback for post-processing the supplied test instance.void
TestInstancePreConstructCallback.preConstructTestInstance
(TestInstanceFactoryContext factoryContext, ExtensionContext context) Callback invoked prior to test instances being constructed.void
TestInstancePreDestroyCallback.preDestroyTestInstance
(ExtensionContext context) Callback for processing test instances before they are destroyed.static void
TestInstancePreDestroyCallback.preDestroyTestInstances
(ExtensionContext context, Consumer<Object> callback) Utility method for processing all test instances of anExtensionContext
that are not present in any of its parent contexts.default void
ClassTemplateInvocationContext.prepareInvocation
(ExtensionContext context) Prepare the imminent invocation of the class template.default void
TestTemplateInvocationContext.prepareInvocation
(ExtensionContext context) Prepare the imminent invocation of the test template.Stream
<? extends ClassTemplateInvocationContext> ClassTemplateInvocationContextProvider.provideClassTemplateInvocationContexts
(ExtensionContext context) Provide invocation contexts for the class template represented by the suppliedcontext
.TestTemplateInvocationContextProvider.provideTestTemplateInvocationContexts
(ExtensionContext context) Provide invocation contexts for the test template method represented by the suppliedcontext
.ParameterResolver.resolveParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) Resolve an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.boolean
ClassTemplateInvocationContextProvider.supportsClassTemplate
(ExtensionContext context) Determine if this provider supports providing invocation contexts for the class template represented by the suppliedcontext
.boolean
ParameterResolver.supportsParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) Determine if this resolver supports resolution of an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.boolean
TestTemplateInvocationContextProvider.supportsTestTemplate
(ExtensionContext context) Determine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext
.default void
TestWatcher.testAborted
(ExtensionContext context, Throwable cause) Invoked after a test has been aborted.default void
TestWatcher.testDisabled
(ExtensionContext context, Optional<String> reason) Invoked after a disabled test has been skipped.default void
TestWatcher.testFailed
(ExtensionContext context, Throwable cause) Invoked after a test has failed.default void
TestWatcher.testSuccessful
(ExtensionContext context) Invoked after a test has completed successfully. -
Uses of ExtensionContext in org.junit.jupiter.api.extension.support
Methods in org.junit.jupiter.api.extension.support with parameters of type ExtensionContextModifier and TypeMethodDescriptionabstract T
TypeBasedParameterResolver.resolveParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) final boolean
TypeBasedParameterResolver.supportsParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) -
Uses of ExtensionContext in org.junit.jupiter.api.io
Methods in org.junit.jupiter.api.io with parameters of type ExtensionContextModifier and TypeMethodDescriptionTempDirFactory.createTempDirectory
(AnnotatedElementContext elementContext, ExtensionContext extensionContext) Create a new temporary directory.TempDirFactory.Standard.createTempDirectory
(AnnotatedElementContext elementContext, ExtensionContext extensionContext) -
Uses of ExtensionContext in org.junit.jupiter.engine.descriptor
Methods in org.junit.jupiter.engine.descriptor with parameters of type ExtensionContextModifier and TypeMethodDescriptionprotected void
TestMethodTestDescriptor.prepareExtensionContext
(ExtensionContext extensionContext) protected void
TestTemplateInvocationTestDescriptor.prepareExtensionContext
(ExtensionContext extensionContext) -
Uses of ExtensionContext in org.junit.jupiter.engine.execution
Methods in org.junit.jupiter.engine.execution that return ExtensionContextModifier and TypeMethodDescriptionExtensionContextSupplier.get
(TestInstantiationAwareExtension extension) ExtensionContextSupplier.ScopeBasedExtensionContextSupplier.get
(TestInstantiationAwareExtension extension) JupiterEngineExecutionContext.getExtensionContext()
Methods in org.junit.jupiter.engine.execution with parameters of type ExtensionContextModifier and TypeMethodDescriptionInterceptingExecutableInvoker.ReflectiveInterceptorCall.apply
(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext) void
InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall.apply
(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) static ExtensionContextSupplier
ExtensionContextSupplier.create
(ExtensionContext currentExtensionContext, ExtensionContext legacyExtensionContext, JupiterConfiguration configuration) ConditionEvaluator.evaluate
(ExtensionRegistry extensionRegistry, JupiterConfiguration configuration, ExtensionContext context) Evaluate allExecutionCondition
extensions registered for the suppliedExtensionContext
.<T> T
InterceptingExecutableInvoker.invoke
(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T> interceptorCall) Invoke the supplied method with dynamic parameter resolution.void
AfterEachMethodAdapter.invokeAfterEachMethod
(ExtensionContext context, ExtensionRegistry registry) void
BeforeEachMethodAdapter.invokeBeforeEachMethod
(ExtensionContext context, ExtensionRegistry registry) static Object[]
ParameterResolutionUtils.resolveParameters
(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry) Resolve the array of parameters for the supplied executable, target, and outer instance.static Object[]
ParameterResolutionUtils.resolveParameters
(Method method, Optional<Object> target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry) Resolve the array of parameters for the supplied method and target.JupiterEngineExecutionContext.Builder.withExtensionContext
(ExtensionContext extensionContext) Constructors in org.junit.jupiter.engine.execution with parameters of type ExtensionContextModifierConstructorDescriptionDefaultExecutableInvoker
(ExtensionContext extensionContext, ExtensionRegistry extensionRegistry) -
Uses of ExtensionContext in org.junit.jupiter.engine.extension
Subinterfaces of ExtensionContext in org.junit.jupiter.engine.extensionModifier and TypeInterfaceDescriptioninterface
ExtensionContextInternal
extends theExtensionContext
with internal API. -
Uses of ExtensionContext in org.junit.jupiter.migrationsupport.conditions
Methods in org.junit.jupiter.migrationsupport.conditions with parameters of type ExtensionContextModifier and TypeMethodDescriptionIgnoreCondition.evaluateExecutionCondition
(ExtensionContext context) Containers/tests are disabled if@Ignore
is present on the test class or method. -
Uses of ExtensionContext in org.junit.jupiter.migrationsupport.rules
Methods in org.junit.jupiter.migrationsupport.rules with parameters of type ExtensionContextModifier and TypeMethodDescriptionvoid
ExpectedExceptionSupport.afterEach
(ExtensionContext context) void
ExternalResourceSupport.afterEach
(ExtensionContext context) void
VerifierSupport.afterEach
(ExtensionContext context) void
ExternalResourceSupport.beforeEach
(ExtensionContext context) void
ExpectedExceptionSupport.handleTestExecutionException
(ExtensionContext context, Throwable throwable) -
Uses of ExtensionContext in org.junit.jupiter.params.aggregator
Methods in org.junit.jupiter.params.aggregator with parameters of type ExtensionContextModifier and TypeMethodDescriptionstatic DefaultArgumentsAccessor
DefaultArgumentsAccessor.create
(ExtensionContext context, int invocationIndex, ClassLoader classLoader, Object[] arguments) -
Uses of ExtensionContext in org.junit.jupiter.params.converter
Constructors in org.junit.jupiter.params.converter with parameters of type ExtensionContext -
Uses of ExtensionContext in org.junit.jupiter.params.provider
Methods in org.junit.jupiter.params.provider with parameters of type ExtensionContextModifier and TypeMethodDescriptionAnnotationBasedArgumentsProvider.provideArguments
(ExtensionContext context, A annotation) Deprecated.Please implementAnnotationBasedArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext, Annotation)
instead.AnnotationBasedArgumentsProvider.provideArguments
(ParameterDeclarations parameters, ExtensionContext context) AnnotationBasedArgumentsProvider.provideArguments
(ParameterDeclarations parameters, ExtensionContext context, A annotation) The returnedStream
will beproperly closed
by the default implementation ofAnnotationBasedArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext)
, making it safe to use a resource such asFiles.lines()
.ArgumentsProvider.provideArguments
(ExtensionContext context) Deprecated.Please implementArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext)
instead.ArgumentsProvider.provideArguments
(ParameterDeclarations parameters, ExtensionContext context) -
Uses of ExtensionContext in org.junit.jupiter.params.support
Methods in org.junit.jupiter.params.support with parameters of type ExtensionContextModifier and TypeMethodDescriptionstatic ParameterInfo
ParameterInfo.get
(ExtensionContext context) Returns the closestParameterInfo
instance for the suppliedExtensionContext
; potentiallynull
.
InvocationInterceptor.interceptDynamicTest(Invocation, DynamicTestInvocationContext, ExtensionContext)
instead