@Override public ConditionEvaluationResult evaluateExecutionCondition(final ExtensionContext context) { return context.getElement() .flatMap(annotatedElement -> AnnotationSupport.findAnnotation(annotatedElement, DisabledOnJava8.class)) .map(annotation -> evaluatedIfJava8()) .orElse(DEFAULT); }
@Override public ConditionEvaluationResult evaluateExecutionCondition(final ExtensionContext context) { return context.getElement() .flatMap(annotatedElement -> AnnotationSupport.findAnnotation(annotatedElement, DisabledOnJava9.class)) .map(annotation -> evaluatedIfJava8()) .orElse(DEFAULT); }
private TestDescriptor createTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method method) { Property property = AnnotationSupport.findAnnotation(method, Property.class).orElseThrow(() -> { String message = String.format("Method [%s] is not annotated with @Property", method); return new JqwikException(message); }); long seed = determineSeed(uniqueId, property.seed()); PropertyConfiguration propertyConfig = PropertyConfiguration.from(property, propertyDefaultValues).withSeed(seed); return new PropertyMethodDescriptor(uniqueId, method, testClass, propertyConfig); }
@Override public boolean supportsTestTemplate(ExtensionContext context) { return context.getTestMethod().filter(m -> AnnotationSupport.isAnnotated(m, testAnnotationClass)).isPresent(); }