Enum Class FailurePolicy

java.lang.Object
java.lang.Enum<FailurePolicy>
org.mockserver.model.FailurePolicy
All Implemented Interfaces:
Serializable, Comparable<FailurePolicy>, Constable

public enum FailurePolicy extends Enum<FailurePolicy>
Controls what happens to an expectation's primary response when a blocking before-action fails or times out.
  • FAIL_FAST — abort the primary action and return an error response to the client (the downstream side-effect is treated as a precondition for responding).
  • BEST_EFFORT — log the failure and continue to the primary action anyway (the side-effect is advisory).

Only meaningful for before-actions; ignored by after-actions, which are always fire-and-forget and run after the response has been written.

  • Enum Constant Details

  • Method Details

    • values

      public static FailurePolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FailurePolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null