Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
8c3cb511
Commit
8c3cb511
authored
Mar 27, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extra test for nested list binding
parent
620e98ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
RelaxedDataBinderTests.java
...org/springframework/boot/bind/RelaxedDataBinderTests.java
+16
-0
No files found.
spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java
View file @
8c3cb511
...
@@ -235,6 +235,14 @@ public class RelaxedDataBinderTests {
...
@@ -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 {
...
@@ -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
>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment