Package net.jqwik.api.lifecycle
Interface PerProperty.Lifecycle
- Enclosing class:
- PerProperty
public static interface PerProperty.Lifecycle
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
after
(PropertyExecutionResult propertyExecutionResult) Override if you want to perform some work once after the annotated property (or example).default void
before
(PropertyLifecycleContext context) Override if you want to perform some work once before the annotated property (or example).default PropertyExecutionResult
onFailure
(PropertyExecutionResult propertyExecutionResult) Override if you want to perform some work or run assertions if - and only if - the property failed.default void
Override if you want to perform some work or run assertions if - and only if - the property succeeded.resolve
(ParameterResolutionContext parameterContext) Override if you want to provide parameters for this property.
-
Method Details
-
resolve
default Optional<ResolveParameterHook.ParameterSupplier> resolve(ParameterResolutionContext parameterContext) Override if you want to provide parameters for this property.- Parameters:
parameterContext
- The object to retrieve information about the parameter to resolve- Returns:
- a supplier wrapped in
Optional.of()
-
before
Override if you want to perform some work once before the annotated property (or example).- Parameters:
context
- The object to retrieve information about the current property
-
after
Override if you want to perform some work once after the annotated property (or example).- Parameters:
propertyExecutionResult
- The object to retrieve information about the property's execution result
-
onSuccess
default void onSuccess()Override if you want to perform some work or run assertions if - and only if - the property succeeded. If you want to make the property fail just use an appropriate assertion methods or throw an exception. -
onFailure
Override if you want to perform some work or run assertions if - and only if - the property failed. You have to return the originalpropertyExecutionResult
or transform it into another result.- Parameters:
propertyExecutionResult
- The object that represents the property's execution result
-