Package org.junit.jupiter.api.condition
Class EnabledIfEnvironmentVariableCondition
- java.lang.Object
-
- org.junit.jupiter.api.condition.EnabledIfEnvironmentVariableCondition
-
- All Implemented Interfaces:
ExecutionCondition
,Extension
class EnabledIfEnvironmentVariableCondition extends java.lang.Object implements ExecutionCondition
- Since:
- 5.1
- See Also:
EnabledIfEnvironmentVariable
-
-
Field Summary
Fields Modifier and Type Field Description private static ConditionEvaluationResult
ENABLED_BY_DEFAULT
-
Constructor Summary
Constructors Constructor Description EnabledIfEnvironmentVariableCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConditionEvaluationResult
evaluateExecutionCondition(ExtensionContext context)
Evaluate this condition for the suppliedExtensionContext
.protected java.lang.String
getEnvironmentVariable(java.lang.String name)
Get the value of the named environment variable.
-
-
-
Field Detail
-
ENABLED_BY_DEFAULT
private static final ConditionEvaluationResult ENABLED_BY_DEFAULT
-
-
Method Detail
-
evaluateExecutionCondition
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context)
Description copied from interface:ExecutionCondition
Evaluate this condition for the suppliedExtensionContext
.An enabled result indicates that the container or test should be executed; whereas, a disabled result indicates that the container or test should not be executed.
- Specified by:
evaluateExecutionCondition
in interfaceExecutionCondition
- Parameters:
context
- the current extension context; nevernull
- Returns:
- the result of evaluating this condition; never
null
-
getEnvironmentVariable
protected java.lang.String getEnvironmentVariable(java.lang.String name)
Get the value of the named environment variable.The default implementation simply delegates to
System.getenv(String)
. Can be overridden in a subclass for testing purposes.
-
-