Top Fields Constructors Methods
org.junit.jupiter.params

pack-priv Class InstancePostProcessingClassTemplateFieldInjector

extends Object
implements TestInstancePostProcessor
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.TestInstantiationAwareExtension, org.junit.jupiter.api.extension.Extension
Imports
org.junit.jupiter.api.extension.ExtensionContext, .TestInstancePostProcessor

Field Summary

Modifier and TypeField and Description
private final EvaluatedArgumentSet
private final int
private final ResolutionCache
private final ResolverFacade

Constructor Summary

AccessConstructor and Description
pack-priv
InstancePostProcessingClassTemplateFieldInjector(ResolverFacade resolverFacade, EvaluatedArgumentSet arguments, int invocationIndex, ResolutionCache resolutionCache)

Method Summary

Modifier and TypeMethod and Description
public TestInstantiationAwareExtension.ExtensionContextScope
getTestInstantiationExtensionContextScope(ExtensionContext rootContext)

Overrides default org.junit.jupiter.api.extension.TestInstantiationAwareExtension.getTestInstantiationExtensionContextScope.

Determine whether this extension should receive a test-method scoped ExtensionContext during the instantiation of test classes or processing of test instances.

public void
postProcessTestInstance(Object testInstance, ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.TestInstancePostProcessor.postProcessTestInstance.

Callback for post-processing the supplied test instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
private final EvaluatedArgumentSet arguments
invocationIndexback to summary
private final int invocationIndex
resolutionCacheback to summary
private final ResolutionCache resolutionCache
resolverFacadeback to summary
private final ResolverFacade resolverFacade

Constructor Detail

InstancePostProcessingClassTemplateFieldInjectorback to summary
pack-priv InstancePostProcessingClassTemplateFieldInjector(ResolverFacade resolverFacade, EvaluatedArgumentSet arguments, int invocationIndex, ResolutionCache resolutionCache)

Method Detail

getTestInstantiationExtensionContextScopeback to summary
public TestInstantiationAwareExtension.ExtensionContextScope getTestInstantiationExtensionContextScope(ExtensionContext rootContext)

Overrides default org.junit.jupiter.api.extension.TestInstantiationAwareExtension.getTestInstantiationExtensionContextScope.

Doc from org.junit.jupiter.api.extension.TestInstantiationAwareExtension.getTestInstantiationExtensionContextScope.

Determine whether this extension should receive a test-method scoped ExtensionContext during the instantiation of test classes or processing of test instances.

If an extension returns TEST_METHOD from this method, methods defined in the following extension APIs will be called with a test-method scoped ExtensionContext instead of a test-class scoped context. Note, however, that a test-class scoped context will always be supplied if the PER_CLASS test instance lifecycle is used.

When a test-method scoped ExtensionContext is supplied, implementations of the above extension APIs will observe the following differences.

Note

The behavior which is enabled by returning TEST_METHOD from this method will become the default in future versions of JUnit. To ensure forward compatibility, extension authors are therefore advised to opt into this feature, even if they do not require the new functionality.

Annotations
@Override
postProcessTestInstanceback to summary
public void postProcessTestInstance(Object testInstance, ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.TestInstancePostProcessor.postProcessTestInstance.

Doc from org.junit.jupiter.api.extension.TestInstancePostProcessor.postProcessTestInstance.

Callback for post-processing the supplied test instance.

By default, the supplied ExtensionContext represents the test class that's being post-processed. Extensions may override getTestInstantiationExtensionContextScope to return TEST_METHOD in order to change the scope of the ExtensionContext to the test method, unless the PER_CLASS lifecycle is used. Changing the scope makes test-specific data available to the implementation of this method and allows keeping state on the test level by using the provided Store instance.

Note

the ExtensionContext supplied to a TestInstancePostProcessor will always return an empty java.util.Optional value from getTestInstance(). A TestInstancePostProcessor should therefore only attempt to process the supplied testInstance.

Annotations
@Override