public class ViolationMatchers
extends java.lang.Object
ConstraintViolations.| Constructor and Description |
|---|
ViolationMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends javax.validation.ConstraintViolation<T>>> |
fails()
Checks that validation fails, i.e.
|
static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> |
on(java.lang.String pathExpression)
Checks that a violation occurs on a given property.
|
static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends javax.validation.ConstraintViolation<T>>> |
succeeds()
Checks that violation succeeds, i.e.
|
static <T> org.hamcrest.Matcher<java.lang.Iterable<javax.validation.ConstraintViolation<T>>> |
violates(java.util.Collection<org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>> matchers)
Checks that a collection of violations contains at least one violation
and that each of the given matchers matches at least one of its elements.
|
static <T> org.hamcrest.Matcher<java.lang.Iterable<javax.validation.ConstraintViolation<T>>> |
violates(org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>... matchers)
Checks that a collection of violations contains at least one violation
and that each of the given matchers matches at least one of its elements.
|
static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> |
violation(java.util.Collection<org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>> matchers)
Checks that a violation satisfies a set of conditions.
|
static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> |
violation(org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>... matchers)
Checks that a violation satisfies a set of conditions.
|
static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> |
withError(java.lang.String messagePart)
Checks that a violation's error message template contains a given string.
|
public static <T> org.hamcrest.Matcher<java.lang.Iterable<javax.validation.ConstraintViolation<T>>> violates(org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>... matchers)
public static <T> org.hamcrest.Matcher<java.lang.Iterable<javax.validation.ConstraintViolation<T>>> violates(java.util.Collection<org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>> matchers)
public static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends javax.validation.ConstraintViolation<T>>> fails()
public static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends javax.validation.ConstraintViolation<T>>> succeeds()
public static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> violation(org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>... matchers)
public static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> violation(java.util.Collection<org.hamcrest.Matcher<? super javax.validation.ConstraintViolation<T>>> matchers)
public static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> on(java.lang.String pathExpression)
foo.bar would
check that the violation applies to the bar property of the object accessed
by the foo property.public static <T> org.hamcrest.Matcher<javax.validation.ConstraintViolation<T>> withError(java.lang.String messagePart)