junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java
raw symbols SCIP| 1 | /* |
| 2 | * Copyright 2015-2024 the original author or authors. |
| 3 | * |
| 4 | * All rights reserved. This program and the accompanying materials are |
| 5 | * made available under the terms of the Eclipse Public License v2.0 which |
| 6 | * accompanies this distribution and is available at |
| 7 | * |
| 8 | * https://www.eclipse.org/legal/epl-v20.html |
| 9 | */ |
| 10 | |
| 11 | package org.junit.jupiter.api.condition; |
| 12 | |
| 13 | import org.junit.jupiter.api.extension.ExecutionCondition; |
| 14 | |
| 15 | /** |
| 16 | * {@link ExecutionCondition} for {@link DisabledIf @DisabledIf}. |
| 17 | * |
| 18 | * @since 5.7 |
| 19 | * @see DisabledIf |
| 20 | */ |
| 21 | class DisabledIfCondition extends MethodBasedCondition<DisabledIf> { |
| 22 | |
| 23 | DisabledIfCondition() { |
| 24 | super(DisabledIf.class, DisabledIf::value, DisabledIf::disabledReason); |
| 25 | } |
| 26 | |
| 27 | @Override |
| 28 | protected boolean isEnabled(boolean methodResult) { |
| 29 | return !methodResult; |
| 30 | } |
| 31 | } |