net.jqwik.spring.EnabledIfHook Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jqwik-spring Show documentation
Show all versions of jqwik-spring Show documentation
Jqwik Spring support module
package net.jqwik.spring;
import net.jqwik.api.lifecycle.*;
import org.junit.jupiter.api.extension.*;
import org.springframework.test.context.junit.jupiter.*;
class EnabledIfHook implements SkipExecutionHook {
@Override
public SkipResult shouldBeSkipped(LifecycleContext context) {
if (!context.findAnnotation(EnabledIf.class).isPresent()) {
return SkipResult.doNotSkip();
}
ExtensionContext extensionContext = new JupiterExtensionContextAdapter(context);
ConditionEvaluationResult evaluationResult = new EnabledIfCondition().evaluateExecutionCondition(extensionContext);
if (evaluationResult.isDisabled()) {
return SkipResult.skip(evaluationResult.getReason().orElse(null));
}
return SkipResult.doNotSkip();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy