use of grails.validation.TestClass in project grails-core by grails.
the class ScaleConstraintTests method proceedValidation.
private Object proceedValidation(Constraint constraint, Object value) {
BeanWrapper constrainedBean = new BeanWrapperImpl(new TestClass());
constrainedBean.setPropertyValue(constraint.getPropertyName(), value);
Errors errors = new BindException(constrainedBean.getWrappedInstance(), constrainedBean.getWrappedClass().getName());
assertFalse(errors.hasErrors());
constraint.validate(constrainedBean.getWrappedInstance(), value, errors);
return constrainedBean.getPropertyValue(constraint.getPropertyName());
}
Aggregations