abstract class MethodBasedCondition<A extends java.lang.annotation.Annotation> extends java.lang.Object implements ExecutionCondition
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<A> |
annotationType |
private java.util.function.Function<A,java.lang.String> |
customDisabledReason |
private java.util.function.Function<A,java.lang.String> |
methodName |
| Constructor and Description |
|---|
MethodBasedCondition(java.lang.Class<A> annotationType,
java.util.function.Function<A,java.lang.String> methodName,
java.util.function.Function<A,java.lang.String> customDisabledReason) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
acceptsExtensionContextOrNoArguments(java.lang.reflect.Method method) |
private ConditionEvaluationResult |
buildConditionEvaluationResult(boolean methodResult,
A annotation) |
private ConditionEvaluationResult |
enabledByDefault() |
ConditionEvaluationResult |
evaluateExecutionCondition(ExtensionContext context)
Evaluate this condition for the supplied
ExtensionContext. |
private java.lang.reflect.Method |
findMethod(java.lang.Class<?> clazz,
java.lang.String methodName) |
(package private) java.lang.reflect.Method |
getConditionMethod(java.lang.String fullyQualifiedMethodName,
ExtensionContext context) |
private boolean |
invokeConditionMethod(java.lang.reflect.Method method,
ExtensionContext context) |
protected abstract boolean |
isEnabled(boolean methodResult) |
private final java.lang.Class<A extends java.lang.annotation.Annotation> annotationType
private final java.util.function.Function<A extends java.lang.annotation.Annotation,java.lang.String> methodName
private final java.util.function.Function<A extends java.lang.annotation.Annotation,java.lang.String> customDisabledReason
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context)
ExecutionConditionExtensionContext.
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.
evaluateExecutionCondition in interface ExecutionConditioncontext - the current extension context; never nullnulljava.lang.reflect.Method getConditionMethod(java.lang.String fullyQualifiedMethodName,
ExtensionContext context)
private java.lang.reflect.Method findMethod(java.lang.Class<?> clazz,
java.lang.String methodName)
private boolean invokeConditionMethod(java.lang.reflect.Method method,
ExtensionContext context)
private boolean acceptsExtensionContextOrNoArguments(java.lang.reflect.Method method)
private ConditionEvaluationResult buildConditionEvaluationResult(boolean methodResult, A annotation)
protected abstract boolean isEnabled(boolean methodResult)
private ConditionEvaluationResult enabledByDefault()