public class TestUtils extends Object
Constructor and Description |
---|
TestUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
assertConstraintTypesFound(javax.validation.metadata.ElementDescriptor.ConstraintFinder constraintFinder,
Class<? extends Annotation>... types)
Assert that the specified ConstraintFinder provides constraints of each of the specified types.
|
static <T> int |
countViolations(Set<javax.validation.ConstraintViolation<T>> violations,
String propertyPath) |
static void |
failOnModifiable(Collection<?> collection,
String description)
assume set addition either does nothing, returning false per collection
contract, or throws an Exception; in either case size should remain
unchanged
|
static <T> javax.validation.ConstraintViolation<T> |
getViolation(Set<javax.validation.ConstraintViolation<T>> violations,
String propertyPath) |
static <T> javax.validation.ConstraintViolation<T> |
getViolationWithMessage(Set<javax.validation.ConstraintViolation<T>> violations,
String message) |
public static <T> javax.validation.ConstraintViolation<T> getViolation(Set<javax.validation.ConstraintViolation<T>> violations, String propertyPath)
violations
- propertyPath
- - string format of a propertyPathpublic static <T> int countViolations(Set<javax.validation.ConstraintViolation<T>> violations, String propertyPath)
violations
- propertyPath
- public static <T> javax.validation.ConstraintViolation<T> getViolationWithMessage(Set<javax.validation.ConstraintViolation<T>> violations, String message)
T
- violations
- message
- public static void failOnModifiable(Collection<?> collection, String description)
collection
- public static void assertConstraintTypesFound(javax.validation.metadata.ElementDescriptor.ConstraintFinder constraintFinder, Class<? extends Annotation>... types)
constraintFinder
- types
- Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.