use of org.hibernate.validator.internal.constraintvalidators.bv.number.bound.decimal.DecimalMinValidatorForCharSequence in project hibernate-validator by hibernate.
the class MinValidatorForStringTest method testIsValidDecimalMinValidator.
@Test
public void testIsValidDecimalMinValidator() {
ConstraintAnnotationDescriptor.Builder<DecimalMin> descriptorBuilder = new ConstraintAnnotationDescriptor.Builder<>(DecimalMin.class);
descriptorBuilder.setAttribute("value", "1500E-2");
descriptorBuilder.setMessage("{validator.min}");
DecimalMin m = descriptorBuilder.build().getAnnotation();
DecimalMinValidatorForCharSequence constraint = new DecimalMinValidatorForCharSequence();
constraint.initialize(m);
testMinValidator(constraint, true);
}
use of org.hibernate.validator.internal.constraintvalidators.bv.number.bound.decimal.DecimalMinValidatorForCharSequence in project hibernate-validator by hibernate.
the class MinValidatorForStringTest method testIsValidDecimalMinExclusive.
@Test
@TestForIssue(jiraKey = "HV-256")
public void testIsValidDecimalMinExclusive() {
boolean inclusive = false;
ConstraintAnnotationDescriptor.Builder<DecimalMin> descriptorBuilder = new ConstraintAnnotationDescriptor.Builder<>(DecimalMin.class);
descriptorBuilder.setAttribute("value", "1500E-2");
descriptorBuilder.setAttribute("inclusive", inclusive);
descriptorBuilder.setMessage("{validator.min}");
DecimalMin m = descriptorBuilder.build().getAnnotation();
DecimalMinValidatorForCharSequence constraint = new DecimalMinValidatorForCharSequence();
constraint.initialize(m);
testMinValidator(constraint, inclusive);
}
Aggregations