@Test public void testCheckValidLong() { MaxBean bean = new MaxBean(); Set<ConstraintViolation<MaxBean>> violations; ConstraintViolation<MaxBean> violation; bean.longProperty().set(2L); violations = validator.validate(bean); assertEquals(violations.size(), 1); violation = violations.iterator().next(); assertEquals(violation.getPropertyPath().iterator().next().getName(), "longProperty", "2 is more than 1"); bean.longProperty().set(1L); violations = validator.validate(bean); assertEquals(violations.size(), 0, "1 is equal to 1"); bean.longProperty().set(0L); violations = validator.validate(bean); assertEquals(violations.size(), 0, "0 is less than 1"); }
@Override protected boolean checkValidLong(final Long value) { return value <= maxValue; }
MaxPropertyValidator extends AbstractNumberValidator<Max> { @Override protected boolean checkValidLong(final Long value) { return value <= maxValue; } }
MaxPropertyValidator extends AbstractNumberValidator<Max> { @Override protected boolean checkValidLong(final Long value) { return value <= maxValue; }  }
MaxPropertyValidator extends AbstractNumberValidator<Max> { @Override protected boolean checkValidLong(final Long value) { return value <= maxValue; }  @Override void initialize(final Max constraint); }
MaxPropertyValidator extends AbstractNumberValidator<Max> { @Override protected boolean checkValidLong(final Long value) { return value <= maxValue; }  @Override void initialize(final Max constraint);  }