* @userStory xyz
* @expectedResults Correct ConstraintViolationException is thrown.
*/
public void testSize() {
try {
BeanValidationEntity bve = new BeanValidationEntity();
bve.setName("ab"); // constraint require 3 characters
em.persist(bve);
Assert.fail("@Size constraint was violated.");
} catch (ConstraintViolationException cve) {
Assert.assertEquals(cve.getConstraintViolations().size(), 1, "Wrong number of constraint violations.");
ConstraintViolation<?> cv = cve.getConstraintViolations().iterator().next();