@Test public void testP2M2D() { NotificationRow value = new NotificationRow(); value.setExpiresAt("P2M2D"); boolean result = validator.isValid(value, context); assertTrue(result); assertTrue(errorMessages.isEmpty()); }
@Override public boolean isValid(NotificationRow value, ConstraintValidatorContext context) { if (!isValid(value)) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION) .addConstraintViolation(); return false; } return true; }
NotificationValueValidator implements ConstraintValidator<ValidNotificationValue, NotificationRow> { @Override public boolean isValid(NotificationRow value, ConstraintValidatorContext context) { if (!isValid(value)) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION) .addConstraintViolation(); return false; } return true; } }
NotificationValueValidator implements ConstraintValidator<ValidNotificationValue, NotificationRow> { @Override public boolean isValid(NotificationRow value, ConstraintValidatorContext context) { if (!isValid(value)) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION) .addConstraintViolation(); return false; } return true; }  }
NotificationValueValidator implements ConstraintValidator<ValidNotificationValue, NotificationRow> { @Override public boolean isValid(NotificationRow value, ConstraintValidatorContext context) { if (!isValid(value)) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION) .addConstraintViolation(); return false; } return true; }  @Override void initialize(ValidNotificationValue constraintAnnotation); @Override boolean isValid(NotificationRow value, ConstraintValidatorContext context); boolean isValid(NotificationRow value); }
NotificationValueValidator implements ConstraintValidator<ValidNotificationValue, NotificationRow> { @Override public boolean isValid(NotificationRow value, ConstraintValidatorContext context) { if (!isValid(value)) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION) .addConstraintViolation(); return false; } return true; }  @Override void initialize(ValidNotificationValue constraintAnnotation); @Override boolean isValid(NotificationRow value, ConstraintValidatorContext context); boolean isValid(NotificationRow value); static final String WRONG_EXPIRES_AT_EXPRESSION; static final String keywords; public Map<Expiration, Predicate> validators; }