Package org.junit.jupiter.api.extension
Class ConditionEvaluationResult
- java.lang.Object
-
- org.junit.jupiter.api.extension.ConditionEvaluationResult
-
@API(status=STABLE, since="5.0") public class ConditionEvaluationResult extends java.lang.ObjectThe result of evaluating anExecutionCondition.- Since:
- 5.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConditionEvaluationResultdisabled(java.lang.String reason)Factory for creating disabled results.static ConditionEvaluationResultdisabled(java.lang.String reason, java.lang.String customReason)Factory for creating disabled results with custom reasons added by the user.static ConditionEvaluationResultenabled(java.lang.String reason)Factory for creating enabled results.java.util.Optional<java.lang.String>getReason()Get the reason why the container or test should be enabled or disabled, if available.booleanisDisabled()Whether the container or test should be disabled.java.lang.StringtoString()
-
-
-
Method Detail
-
enabled
public static ConditionEvaluationResult enabled(java.lang.String reason)
Factory for creating enabled results.- Parameters:
reason- the reason why the container or test should be enabled; may benullor blank if the reason is unknown- Returns:
- an enabled
ConditionEvaluationResultwith the given reason or an empty reason if the reason is unknown - See Also:
StringUtils.isBlank(String)
-
disabled
public static ConditionEvaluationResult disabled(java.lang.String reason)
Factory for creating disabled results.- Parameters:
reason- the reason why the container or test should be disabled; may benullor blank if the reason is unknown- Returns:
- a disabled
ConditionEvaluationResultwith the given reason or an empty reason if the reason is unknown - See Also:
StringUtils.isBlank(String)
-
disabled
@API(status=STABLE, since="5.7") public static ConditionEvaluationResult disabled(java.lang.String reason, java.lang.String customReason)Factory for creating disabled results with custom reasons added by the user.If non-blank default and custom reasons are provided, they will be concatenated using the format:
"reason ==> customReason".- Parameters:
reason- the default reason why the container or test should be disabled; may benullor blank if the default reason is unknowncustomReason- the custom reason why the container or test should be disabled; may benullor blank if the custom reason is unknown- Returns:
- a disabled
ConditionEvaluationResultwith the given reason(s) or an empty reason if the reasons are unknown - Since:
- 5.7
- See Also:
StringUtils.isBlank(String)
-
isDisabled
public boolean isDisabled()
Whether the container or test should be disabled.- Returns:
trueif the container or test should be disabled
-
getReason
public java.util.Optional<java.lang.String> getReason()
Get the reason why the container or test should be enabled or disabled, if available.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-