In order to create extensions that activate or deactivate tests depending on a given condition, JUnit 5 provides one conditional extension point callled ExecutionCondition. The following snippet shows the declaration of this extension point:
package org.junit.jupiter.api.extension;
import static org.apiguardian.api.API.Status.STABLE;
import org.apiguardian.api.API;
@FunctionalInterface
@API(status = STABLE, since = "5.0")
public interface ExecutionCondition extends Extension {
ConditionEvaluationResult evaluateExecutionCondition
ExtensionContext context);
}
The extension can be used to deactivate either all tests in a container (likely a class) or individual tests (likely a test method). Examples of this extension are provided in the section Conditional Test Execution of chapter 3, JUnit 5 Standard Tests.