Package com.totvs.tjf.test.support
Class ConstraintAsserts
java.lang.Object
com.totvs.tjf.test.support.ConstraintAsserts
Asserts helper to validates bean instances using a fluent api.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAssert helper for the violations raised up by the bean validation process.static classAssert helper for the violation identified in the bean validation process. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ConstraintAsserts.AssertConstraint<T>assertThatViolationsFor(T object, Class<?>... groups) Validates all constraints onobjectand build an instance ofConstraintAssertsto assert the violations for the supplied object.static <T> ConstraintAsserts.AssertConstraint<T>assertThatViolationsFor(T object, String property, Class<?>... groups) Validates all constraints placed on the property ofobjectand build an instance ofConstraintAssertsto assert the violations for the supplied object.
-
Method Details
-
assertThatViolationsFor
public static <T> ConstraintAsserts.AssertConstraint<T> assertThatViolationsFor(@NonNull T object, Class<?>... groups) Validates all constraints onobjectand build an instance ofConstraintAssertsto assert the violations for the supplied object.- Type Parameters:
T- the type of the object to validate.- Parameters:
object- to validate.groups- the group or list of groups targeted for validation (defaults toDefault).- Returns:
- com.totvs.tjf.test.support.AssertConstraint
- Throws:
javax.validation.ValidationException- if a non recoverable error happens during the validation process.
-
assertThatViolationsFor
public static <T> ConstraintAsserts.AssertConstraint<T> assertThatViolationsFor(@NonNull T object, @NonNull String property, Class<?>... groups) Validates all constraints placed on the property ofobjectand build an instance ofConstraintAssertsto assert the violations for the supplied object.- Type Parameters:
T- the type of the object to validate.- Parameters:
object- to validate.property- in the object to validate.groups- the group or list of groups targeted for validation (defaults toDefault).@param property- Returns:
- com.totvs.tjf.test.support.AssertConstraint
- Throws:
javax.validation.ValidationException- if a non recoverable error happens during the validation process.
-