diff --git a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java index 138bcef223..1bb2d99c1d 100644 --- a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java @@ -235,6 +235,14 @@ public class RelaxedDataBinderTests { 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 public void testBindNestedReadOnlyCollectionIndexed() throws Exception { 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 { private final Collection nested = new ArrayList();