use of cn.taketoday.validation.BeanWithObjectProperty in project today-framework by TAKETODAY.
the class DataBinderTests method testBindingWithCustomEditorOnObjectField.
@Test
void testBindingWithCustomEditorOnObjectField() {
BeanWithObjectProperty tb = new BeanWithObjectProperty();
DataBinder binder = new DataBinder(tb);
binder.registerCustomEditor(Integer.class, "object", new CustomNumberEditor(Integer.class, true));
PropertyValues pvs = new PropertyValues();
pvs.add("object", "1");
binder.bind(pvs);
assertThat(tb.getObject()).isEqualTo(1);
}
Aggregations