Module org.junit.jupiter.api
Package org.junit.jupiter.api.extension
Enum Class TestInstantiationAwareExtension.ExtensionContextScope
java.lang.Object
java.lang.Enum<TestInstantiationAwareExtension.ExtensionContextScope>
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope
- All Implemented Interfaces:
Serializable
,Comparable<TestInstantiationAwareExtension.ExtensionContextScope>
,Constable
- Enclosing interface:
TestInstantiationAwareExtension
@API(status=EXPERIMENTAL,
since="5.12")
public static enum TestInstantiationAwareExtension.ExtensionContextScope
extends Enum<TestInstantiationAwareExtension.ExtensionContextScope>
ExtensionContextScope
is used to define the scope of the
ExtensionContext
passed to an extension during the instantiation
of test instances.- Since:
- 5.12
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDeprecated.The extension should receive anExtensionContext
scoped to the test method, unless thePER_CLASS
lifecycle is used. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property name used to set the default extension context scope: "junit.jupiter.extensions.testinstantiation.extensioncontextscope.default" -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
@API(status=DEPRECATED, since="5.12") @Deprecated public static final TestInstantiationAwareExtension.ExtensionContextScope DEFAULTDeprecated.This behavior will be removed from future versions of JUnit andTEST_METHOD
will become the default.The extension should receive anExtensionContext
scoped to in the default scope.The default scope is determined by the configuration parameter
DEFAULT_SCOPE_PROPERTY_NAME
. If not specified, extensions will receive anExtensionContext
scoped to the test class.- See Also:
-
TEST_METHOD
The extension should receive anExtensionContext
scoped to the test method, unless thePER_CLASS
lifecycle is used.
-
-
Field Details
-
DEFAULT_SCOPE_PROPERTY_NAME
Property name used to set the default extension context scope: "junit.jupiter.extensions.testinstantiation.extensioncontextscope.default"Supported Values
Supported values include names of enum constants defined in this class, ignoring case.
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
TEST_METHOD
will become the default.