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 TypeMethodDescriptionvoidAfterAllCallback.afterAll(ExtensionContext context) Callback that is invoked once after all tests in the current container.voidAfterClassTemplateInvocationCallback.afterClassTemplateInvocation(ExtensionContext context) Callback that is invoked after each invocation of a container template.voidAfterEachCallback.afterEach(ExtensionContext context) Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.voidAfterTestExecutionCallback.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.voidBeforeAllCallback.beforeAll(ExtensionContext context) Callback that is invoked once before all tests in the current container.voidBeforeClassTemplateInvocationCallback.beforeClassTemplateInvocation(ExtensionContext context) Callback that is invoked before each invocation of a container template.voidBeforeEachCallback.beforeEach(ExtensionContext context) Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.voidBeforeTestExecutionCallback.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.voidPreInterruptCallback.beforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) Callback that is invoked before aThreadis 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-scopedExtensionContextduring the instantiation of test instances.default voidLifecycleMethodExecutionExceptionHandler.handleAfterAllMethodExecutionException(ExtensionContext context, Throwable throwable) Handle the suppliedThrowablethat was thrown during execution of a@AfterAlllifecycle method.default voidLifecycleMethodExecutionExceptionHandler.handleAfterEachMethodExecutionException(ExtensionContext context, Throwable throwable) Handle the suppliedThrowablethat was thrown during execution of a@AfterEachlifecycle method.default voidLifecycleMethodExecutionExceptionHandler.handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable throwable) Handle the suppliedThrowablethat was thrown during execution of a@BeforeAlllifecycle method.default voidLifecycleMethodExecutionExceptionHandler.handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable throwable) Handle the suppliedThrowablethat was thrown during execution of a@BeforeEachlifecycle method.voidTestExecutionExceptionHandler.handleTestExecutionException(ExtensionContext context, Throwable throwable) Handle the suppliedthrowable.default voidInvocationInterceptor.interceptAfterAllMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of an@AfterAllmethod.default voidInvocationInterceptor.interceptAfterEachMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of an@AfterEachmethod.default voidInvocationInterceptor.interceptBeforeAllMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@BeforeAllmethod.default voidInvocationInterceptor.interceptBeforeEachMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@BeforeEachmethod.default voidInvocationInterceptor.interceptDynamicTest(InvocationInterceptor.Invocation<Void> invocation, DynamicTestInvocationContext invocationContext, ExtensionContext extensionContext) Intercept the invocation of aDynamicTest.default voidInvocationInterceptor.interceptDynamicTest(InvocationInterceptor.Invocation<Void> invocation, ExtensionContext extensionContext) Deprecated.default <T> TInvocationInterceptor.interceptTestClassConstructor(InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<Constructor<T>> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a test class constructor.default <T> TInvocationInterceptor.interceptTestFactoryMethod(InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@TestFactorymethod, such as a@RepeatedTestor@ParameterizedTestmethod.default voidInvocationInterceptor.interceptTestMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@Testmethod.default voidInvocationInterceptor.interceptTestTemplateMethod(InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) Intercept the invocation of a@TestTemplatemethod.default booleanClassTemplateInvocationContextProvider.mayReturnZeroClassTemplateInvocationContexts(ExtensionContext context) Signal that this provider may provide zero invocation contexts for the class template represented by the suppliedcontext.default booleanTestTemplateInvocationContextProvider.mayReturnZeroTestTemplateInvocationContexts(ExtensionContext context) Signal that this provider may provide zero invocation contexts for the test template method represented by the suppliedcontext.voidTestInstancePostProcessor.postProcessTestInstance(Object testInstance, ExtensionContext context) Callback for post-processing the supplied test instance.voidTestInstancePreConstructCallback.preConstructTestInstance(TestInstanceFactoryContext factoryContext, ExtensionContext context) Callback invoked prior to test instances being constructed.voidTestInstancePreDestroyCallback.preDestroyTestInstance(ExtensionContext context) Callback for processing test instances before they are destroyed.static voidTestInstancePreDestroyCallback.preDestroyTestInstances(ExtensionContext context, Consumer<Object> callback) Utility method for processing all test instances of anExtensionContextthat are not present in any of its parent contexts.default voidClassTemplateInvocationContext.prepareInvocation(ExtensionContext context) Prepare the imminent invocation of the class template.default voidTestTemplateInvocationContext.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 theParameterin the suppliedParameterContextfor the suppliedExtensionContext.booleanClassTemplateInvocationContextProvider.supportsClassTemplate(ExtensionContext context) Determine if this provider supports providing invocation contexts for the class template represented by the suppliedcontext.booleanParameterResolver.supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Determine if this resolver supports resolution of an argument for theParameterin the suppliedParameterContextfor the suppliedExtensionContext.booleanTestTemplateInvocationContextProvider.supportsTestTemplate(ExtensionContext context) Determine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext.default voidTestWatcher.testAborted(ExtensionContext context, Throwable cause) Invoked after a test has been aborted.default voidTestWatcher.testDisabled(ExtensionContext context, Optional<String> reason) Invoked after a disabled test has been skipped.default voidTestWatcher.testFailed(ExtensionContext context, Throwable cause) Invoked after a test has failed.default voidTestWatcher.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 TTypeBasedParameterResolver.resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) final booleanTypeBasedParameterResolver.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 voidTestMethodTestDescriptor.prepareExtensionContext(ExtensionContext extensionContext) protected voidTestTemplateInvocationTestDescriptor.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) voidInterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall.apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) static ExtensionContextSupplierExtensionContextSupplier.create(ExtensionContext currentExtensionContext, ExtensionContext legacyExtensionContext, JupiterConfiguration configuration) ConditionEvaluator.evaluate(ExtensionRegistry extensionRegistry, JupiterConfiguration configuration, ExtensionContext context) Evaluate allExecutionConditionextensions registered for the suppliedExtensionContext.<T> TInterceptingExecutableInvoker.invoke(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T> interceptorCall) Invoke the supplied method with dynamic parameter resolution.voidAfterEachMethodAdapter.invokeAfterEachMethod(ExtensionContext context, ExtensionRegistry registry) voidBeforeEachMethodAdapter.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 TypeInterfaceDescriptioninterfaceExtensionContextInternalextends theExtensionContextwith 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@Ignoreis 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 TypeMethodDescriptionvoidExpectedExceptionSupport.afterEach(ExtensionContext context) voidExternalResourceSupport.afterEach(ExtensionContext context) voidVerifierSupport.afterEach(ExtensionContext context) voidExternalResourceSupport.beforeEach(ExtensionContext context) voidExpectedExceptionSupport.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 DefaultArgumentsAccessorDefaultArgumentsAccessor.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 returnedStreamwill beproperly closedby 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 ParameterInfoParameterInfo.get(ExtensionContext context) Returns the closestParameterInfoinstance for the suppliedExtensionContext; potentiallynull.
InvocationInterceptor.interceptDynamicTest(Invocation, DynamicTestInvocationContext, ExtensionContext)instead