Package net.jqwik.api.lifecycle
Interface PerProperty.Lifecycle
-
- Enclosing class:
- PerProperty
public static interface PerProperty.Lifecycle
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default 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
onSuccess()
Override if you want to perform some work or run assertions if - and only if - the property succeeded.default java.util.Optional<ResolveParameterHook.ParameterSupplier>
resolve(ParameterResolutionContext parameterContext)
Override if you want to provide parameters for this property.
-
-
-
Method Detail
-
resolve
default java.util.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
default void before(PropertyLifecycleContext context)
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
default void after(PropertyExecutionResult propertyExecutionResult)
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
default PropertyExecutionResult onFailure(PropertyExecutionResult propertyExecutionResult)
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
-
-