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

public static class ConstraintAsserts.AssertConstraint<T> extends Object
Assert helper for the violations raised up by the bean validation process.
  • Method Details

    • isEmpty

      public void isEmpty()
      Assert that the list of violations is empty, otherwise, fails.
    • hasType

      public ConstraintAsserts.AssertConstraintViolation<T> hasType(@NonNull Class<?> type)
      Lookup the supplied violation type and return an instance of ConstraintAsserts(), 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.