Input validations
Input validations are is a way to add more constraints to a field. They are specified using annotation on checked field.
Useful input validations include:
assertNotEmpty(errorMessage)
- checks that field is not empty (null or empty string)assertDefined(errorMessage)
- checks that field is not nullassertPattern(regExp, errorMessage)
- checks that field matches given regular expressionassertMinLength(min, errorMessage)
andassertMaxLength(max, errorMessage)
- checks that string is at least (or at most) of given length