Package com.totvs.tjf.test.support
Class ConstraintAsserts.AssertConstraint<T>
java.lang.Object
com.totvs.tjf.test.support.ConstraintAsserts.AssertConstraint<T>
- Type Parameters:
T- the type of the validated object.
- Enclosing class:
- ConstraintAsserts
Assert helper for the violations raised up by the bean validation process.
-
Method Summary
Modifier and TypeMethodDescriptionPredicate to be used to filter and lookup for the supplied violation type.Lookup the supplied violation type and return an instance ofConstraintAsserts(), otherwise, fails if the supplied violation type is not founded.voidisEmpty()Assert that the list of violations isempty, otherwise, fails.
-
Method Details
-
isEmpty
public void isEmpty()Assert that the list of violations isempty, otherwise, fails. -
hasType
Lookup the supplied violation type and return an instance ofConstraintAsserts(), otherwise, fails if the supplied violation type is not founded.- Parameters:
type- of the violation to be lookup for.- Returns:
- an instance of
ConstraintAsserts.AssertConstraintViolation.
-
contains
protected Predicate<javax.validation.ConstraintViolation<T>> contains(@NonNull Class<?> violationClass) Predicate to be used to filter and lookup for the supplied violation type.- Parameters:
violationClass- to be lookup for.- Returns:
- the predicate to be applied.
-