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 Details

  • Method Details

    • beforeContainer

      void beforeContainer(ContainerLifecycleContext context) throws Throwable
      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

      @API(status=INTERNAL) default int compareTo(BeforeContainerHook other)