Enum Class CustomValidatorStrategy
- All Implemented Interfaces:
Serializable,Comparable<CustomValidatorStrategy>,Constable
Historical behavior:
By default, custom validators were executed exclusively.
This meant that when a custom validator was provided, the default validation logic (such as body or JSON validation) was skipped entirely.
For example, in the snippet below the body validation would have no effect on the test result:
ReceiveMessageAction receiveAction = new ReceiveMessageAction.Builder()
.getMessageBuilderSupport()
.body("expected body")
.validate((message, context) -> customValidatorInvoked.set(true))
.build();
This behavior originally existed to allow users to fully replace the default validation logic — for example, by providing custom JSON validation that must not be duplicated or interfered with by the built-in validators.
New behavior option:
In some scenarios this exclusivity can be unexpected or misleading.
For these cases the COMBINED strategy allows Citrus to run both the default validators and the custom validator logic together.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomValidatorStrategyReturns the enum constant of this class with the specified name.static CustomValidatorStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMBINED
-
EXCLUSIVE
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-