use of org.springframework.boot.bind.RelaxedDataBinderTests.TargetWithNestedObject in project spring-boot by spring-projects.
the class BindingPreparationTests method testBeanWrapperCreatesNewObjects.
@Test
public void testBeanWrapperCreatesNewObjects() throws Exception {
TargetWithNestedObject target = new TargetWithNestedObject();
BeanWrapperImpl wrapper = new BeanWrapperImpl(target);
wrapper.setAutoGrowNestedPaths(true);
// For a nested object, you have to set a property for it to be created
wrapper.setPropertyValue("nested.foo", "bar");
wrapper.getPropertyValue("nested");
assertThat(wrapper.getPropertyValue("nested")).isNotNull();
}
Aggregations