Package net.jqwik.api.lifecycle
Interface BeforeContainerHook
- All Superinterfaces:
LifecycleHook
- All Known Subinterfaces:
AroundContainerHook
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@API(status=MAINTAINED,
since="1.4.0")
@FunctionalInterface
public interface BeforeContainerHook
extends LifecycleHook
Implement this hook to define behaviour for a container (class or whole test suite)
that should be run exactly once before any of its property methods and child containers.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeContainer
(ContainerLifecycleContext context) The code of this method will be run exactly once before any property method or child container.default int
The higher the value, the closer to the actual property methods, i.e. the later it will be run.default int
compareTo
(BeforeContainerHook other) Methods inherited from interface net.jqwik.api.lifecycle.LifecycleHook
appliesTo, propagateTo
-
Field Details
-
DO_NOTHING
-
-
Method Details
-
beforeContainer
The code of this method will be run exactly once before any property method or child container.- Parameters:
context
- The container's context object- Throws:
Throwable
-
beforeContainerProximity
default int beforeContainerProximity()The higher the value, the closer to the actual property methods, i.e. the later it will be run. Default value is 0.Values greater than -10 will make it run after methods annotated with BeforeContainer, values smaller than -10 will make it run before.
- Returns:
- an integer value
-
compareTo
-