use of org.hibernate.validator.internal.constraintvalidators.bv.number.bound.decimal.DecimalMaxValidatorForCharSequence in project hibernate-validator by hibernate.
the class MaxValidatorForStringTest method testIsValidDecimalMaxExclusive.
@Test
@TestForIssue(jiraKey = "HV-256")
public void testIsValidDecimalMaxExclusive() {
boolean inclusive = false;
ConstraintAnnotationDescriptor.Builder<DecimalMax> descriptorBuilder = new ConstraintAnnotationDescriptor.Builder<>(DecimalMax.class);
descriptorBuilder.setAttribute("value", "15.0E0");
descriptorBuilder.setAttribute("inclusive", inclusive);
descriptorBuilder.setMessage("{validator.max}");
DecimalMax m = descriptorBuilder.build().getAnnotation();
DecimalMaxValidatorForCharSequence constraint = new DecimalMaxValidatorForCharSequence();
constraint.initialize(m);
testMaxValidator(constraint, inclusive);
}
use of org.hibernate.validator.internal.constraintvalidators.bv.number.bound.decimal.DecimalMaxValidatorForCharSequence in project hibernate-validator by hibernate.
the class MaxValidatorForStringTest method testIsValidDecimalMax.
@Test
public void testIsValidDecimalMax() {
ConstraintAnnotationDescriptor.Builder<DecimalMax> descriptorBuilder = new ConstraintAnnotationDescriptor.Builder<>(DecimalMax.class);
descriptorBuilder.setAttribute("value", "15.0E0");
descriptorBuilder.setMessage("{validator.max}");
DecimalMax m = descriptorBuilder.build().getAnnotation();
DecimalMaxValidatorForCharSequence constraint = new DecimalMaxValidatorForCharSequence();
constraint.initialize(m);
testMaxValidator(constraint, true);
}
Aggregations