Skip to content

Commit 25cb827

Browse files
committed
Share V2 skip condition via RequiresV2Api
Move the SKIP_V2_TESTS check into a reusable static method in V2ApiCondition.
1 parent e98ece3 commit 25cb827

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

integration-test/src/test/java/org/cloudfoundry/CloudFoundryCleaner.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ final class CloudFoundryCleaner implements InitializingBean, DisposableBean {
131131

132132
private static final Logger LOGGER = LoggerFactory.getLogger("cloudfoundry-client.test");
133133

134-
private static final boolean RUN_V2_CLEANUP = isRunV2Tests();
135-
136-
private static boolean isRunV2Tests() {
137-
return !"true".equalsIgnoreCase(System.getenv(RequiresV2Api.SKIP_V2_TESTS_ENV));
138-
}
134+
private static final boolean RUN_V2_CLEANUP = RequiresV2Api.V2ApiCondition.isEnabled();
139135

140136
private static final Map<String, Boolean> STANDARD_FEATURE_FLAGS =
141137
FluentMap.<String, Boolean>builder()

integration-test/src/test/java/org/cloudfoundry/RequiresV2Api.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@
5959
*/
6060
class V2ApiCondition implements ExecutionCondition {
6161

62+
/** Returns {@code true} if V2 API tests should run (i.e., not skipped). */
63+
public static boolean isEnabled() {
64+
return !"true".equalsIgnoreCase(System.getenv(SKIP_V2_TESTS_ENV));
65+
}
66+
6267
@Override
6368
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {
64-
if ("true".equalsIgnoreCase(System.getenv(SKIP_V2_TESTS_ENV))) {
69+
if (!isEnabled()) {
6570
return ConditionEvaluationResult.disabled(
6671
"V2 API tests are disabled via "
6772
+ SKIP_V2_TESTS_ENV

0 commit comments

Comments
 (0)