Add extra test for nested list binding
This commit is contained in:
parent
620e98ce24
commit
8c3cb51110
|
|
@ -235,6 +235,14 @@ public class RelaxedDataBinderTests {
|
||||||
assertEquals("[bar, foo]", target.getNested().toString());
|
assertEquals("[bar, foo]", target.getNested().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBindDoubleNestedReadOnlyListIndexed() throws Exception {
|
||||||
|
TargetWithReadOnlyDoubleNestedList target = new TargetWithReadOnlyDoubleNestedList();
|
||||||
|
this.conversionService = new DefaultConversionService();
|
||||||
|
bind(target, "bean.nested[0]:bar\nbean.nested[1]:foo");
|
||||||
|
assertEquals("[bar, foo]", target.getBean().getNested().toString());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBindNestedReadOnlyCollectionIndexed() throws Exception {
|
public void testBindNestedReadOnlyCollectionIndexed() throws Exception {
|
||||||
TargetWithReadOnlyNestedCollection target = new TargetWithReadOnlyNestedCollection();
|
TargetWithReadOnlyNestedCollection target = new TargetWithReadOnlyNestedCollection();
|
||||||
|
|
@ -561,6 +569,14 @@ public class RelaxedDataBinderTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TargetWithReadOnlyDoubleNestedList {
|
||||||
|
TargetWithReadOnlyNestedList bean = new TargetWithReadOnlyNestedList();
|
||||||
|
|
||||||
|
public TargetWithReadOnlyNestedList getBean() {
|
||||||
|
return this.bean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class TargetWithReadOnlyNestedCollection {
|
public static class TargetWithReadOnlyNestedCollection {
|
||||||
private final Collection<String> nested = new ArrayList<String>();
|
private final Collection<String> nested = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue