@Test(expected = ConstraintValidationException.class)
public void should_throw_constraintViolationException_when_bean_is_not_valid() throws Exception {

    BeanValidator validator = new BeanValidator(Validation.buildDefaultValidatorFactory().getValidator());
    validator.validate(anInvalidBean());
}