Top Description Methods
org.junit.jupiter.api.extension

public Interface ExecutionCondition

extends Extension
Known Direct Implementers
org.junit.jupiter.api.condition.AbstractOsBasedExecutionCondition, org.junit.jupiter.api.condition.AbstractRepeatableAnnotationCondition, org.junit.jupiter.api.condition.BooleanExecutionCondition, org.junit.jupiter.api.condition.MethodBasedCondition
Annotations
@FunctionalInterface
@API
status:STABLE
since:5.0
Static Imports
org.apiguardian.api.API.Status.STABLE

ExecutionCondition defines the Extension API for programmatic, conditional test execution.

An ExecutionCondition is evaluated to determine if a given container or test should be executed based on the supplied ExtensionContext.

If an ExecutionCondition disables a test method, that prevents execution of the test method and method-level lifecycle callbacks such as @BeforeEach methods, @AfterEach methods, and corresponding extension APIs. However, that does not prevent the test class from being instantiated, and it does not prevent the execution of class-level lifecycle callbacks such as @BeforeAll methods, @AfterAll methods, and corresponding extension APIs.

Constructor Requirements

Consult the documentation in Extension for details on constructor requirements.

Since
5.0
See Also
org.junit.jupiter.api.Disabled, org.junit.jupiter.api.condition.EnabledIf, org.junit.jupiter.api.condition.DisabledIf, org.junit.jupiter.api.condition.EnabledOnOs, org.junit.jupiter.api.condition.DisabledOnOs, org.junit.jupiter.api.condition.EnabledOnJre, org.junit.jupiter.api.condition.DisabledOnJre, org.junit.jupiter.api.condition.EnabledForJreRange, org.junit.jupiter.api.condition.DisabledForJreRange, org.junit.jupiter.api.condition.EnabledInNativeImage, org.junit.jupiter.api.condition.DisabledInNativeImage, org.junit.jupiter.api.condition.EnabledIfSystemProperty, org.junit.jupiter.api.condition.DisabledIfSystemProperty, org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable, org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable

Method Summary

Modifier and TypeMethod and Description
public ConditionEvaluationResult

Returns:

the result of evaluating this condition; never null
evaluateExecutionCondition
(ExtensionContext
the current extension context; never null
context
)

Evaluate this condition for the supplied ExtensionContext.

Method Detail

evaluateExecutionConditionback to summary
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context)

Evaluate this condition for the supplied ExtensionContext.

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.

Parameters
context:ExtensionContext

the current extension context; never null

Returns:ConditionEvaluationResult

the result of evaluating this condition; never null