Defer decision on BindingResult type until access
Closes gh-24347
This commit is contained in:
@@ -2050,9 +2050,18 @@ public class DataBinderTests {
|
||||
assertThatIllegalStateException().isThrownBy(() ->
|
||||
binder.setMessageCodesResolver(new DefaultMessageCodesResolver()))
|
||||
.withMessageContaining("DataBinder is already initialized with MessageCodesResolver");
|
||||
|
||||
}
|
||||
|
||||
@Test // gh-24347
|
||||
public void overrideBindingResultType() {
|
||||
TestBean testBean = new TestBean();
|
||||
DataBinder binder = new DataBinder(testBean, "testBean");
|
||||
binder.initDirectFieldAccess();
|
||||
binder.initBeanPropertyAccess();
|
||||
assertThat(binder.getBindingResult()).isInstanceOf(BeanPropertyBindingResult.class);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class BeanWithIntegerList {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user