Uses of Interface
org.junit.jupiter.api.extension.ExtensionContext
Package
Description
JUnit Jupiter API for writing extensions.
JUnit Jupiter API support for writing extensions.
Test descriptors used within the JUnit Jupiter test engine.
Internal classes for test execution within 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.
ArgumentsProvider
implementations and their corresponding
ArgumentsSource
annotations.-
Uses of ExtensionContext in org.junit.jupiter.api.extension
Modifier and TypeMethodDescriptionExtensionContext.getParent()
Get the parent extension context, if available.Modifier and TypeMethodDescriptionvoid
AfterAllCallback.afterAll(ExtensionContext context)
Callback that is invoked once after all tests in the current container.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
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.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
.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.void
TestInstancePostProcessor.postProcessTestInstance(Object testInstance, ExtensionContext context)
Callback for post-processing the supplied test instance.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.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
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
Modifier and TypeMethodDescriptionabstract T
TypeBasedParameterResolver.resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
boolean
TypeBasedParameterResolver.supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
-
Uses of ExtensionContext in org.junit.jupiter.engine.descriptor
Modifier and TypeMethodDescriptionprotected TestInstances
ClassBasedTestDescriptor.instantiateTestClass(Optional<TestInstances> outerInstances, ExtensionRegistry registry, ExtensionContext extensionContext)
protected abstract TestInstances
ClassBasedTestDescriptor.instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionRegistry registry, ExtensionRegistrar registrar, ExtensionContext extensionContext, ThrowableCollector throwableCollector)
protected TestInstances
ClassTestDescriptor.instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionRegistry registry, ExtensionRegistrar registrar, ExtensionContext extensionContext, ThrowableCollector throwableCollector)
protected TestInstances
NestedClassTestDescriptor.instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionRegistry registry, ExtensionRegistrar registrar, ExtensionContext extensionContext, ThrowableCollector throwableCollector)
-
Uses of ExtensionContext in org.junit.jupiter.engine.execution
Modifier and TypeMethodDescriptionExecutableInvoker.ReflectiveInterceptorCall.apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext)
void
ExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall.apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext)
ConditionEvaluator.evaluate(ExtensionRegistry extensionRegistry, JupiterConfiguration configuration, ExtensionContext context)
Evaluate allExecutionCondition
extensions registered for the suppliedExtensionContext
.<T> T
ExecutableInvoker.invoke(Constructor<T> constructor, Optional<Object> outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, ExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>,T> interceptorCall)
Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.<T> T
ExecutableInvoker.invoke(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, ExecutableInvoker.ReflectiveInterceptorCall<Method,T> interceptorCall)
Invoke the suppliedstatic
method with dynamic parameter resolution.void
AfterEachMethodAdapter.invokeAfterEachMethod(ExtensionContext context, ExtensionRegistry registry)
void
BeforeEachMethodAdapter.invokeBeforeEachMethod(ExtensionContext context, ExtensionRegistry registry)
JupiterEngineExecutionContext.Builder.withExtensionContext(ExtensionContext extensionContext)
-
Uses of ExtensionContext in org.junit.jupiter.migrationsupport.conditions
Modifier 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
Modifier 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.provider
InvocationInterceptor.interceptDynamicTest(Invocation, DynamicTestInvocationContext, ExtensionContext)
instead