Fix regression with binding and validation
Previously, the binding may have to call the getter first to retrieve the
old value of a property before actually setting it. This was guarded by
a catch block that was accidentally removed in 3d86f15
Restore that catch block and add a test to cover it.
Issue: SPR-12805
This commit is contained in:
@@ -51,6 +51,15 @@ public final class BeanWrapperTests extends AbstractConfigurablePropertyAccessor
|
||||
assertTrue("Set name to tom", target.getName().equals("tom"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getterSilentlyFailWithOldValueExtraction() {
|
||||
GetterBean target = new GetterBean();
|
||||
BeanWrapper accessor = createAccessor(target);
|
||||
accessor.setExtractOldValueForEditor(true); // This will call the getter
|
||||
accessor.setPropertyValue("name", "tom");
|
||||
assertTrue("Set name to tom", target.getName().equals("tom"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setValidAndInvalidPropertyValuesShouldContainExceptionDetails() {
|
||||
TestBean target = new TestBean();
|
||||
|
||||
Reference in New Issue
Block a user