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
b43718c3
Commit
b43718c3
authored
Feb 05, 2019
by
Kedar Joshi
Committed by
Stephane Nicoll
Feb 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
See gh-15853
parent
ecb7e240
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
PropertyMapperTests.java
...ramework/boot/context/properties/PropertyMapperTests.java
+6
-6
No files found.
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java
View file @
b43718c3
...
...
@@ -50,7 +50,7 @@ public class PropertyMapperTests {
@Test
public
void
fromValueAsIntShouldAdaptValue
()
{
Integer
result
=
this
.
map
.
from
(
"123"
).
asInt
(
Long:
:
valueOf
)
.
toInstance
(
Integer:
:
new
);
.
toInstance
(
Integer:
:
valueOf
);
assertThat
(
result
).
isEqualTo
(
123
);
}
...
...
@@ -84,7 +84,7 @@ public class PropertyMapperTests {
@Test
public
void
asIntShouldAdaptSupplier
()
{
Integer
result
=
this
.
map
.
from
(()
->
"123"
).
asInt
(
Long:
:
valueOf
)
.
toInstance
(
Integer:
:
new
);
.
toInstance
(
Integer:
:
valueOf
);
assertThat
(
result
).
isEqualTo
(
123
);
}
...
...
@@ -116,7 +116,7 @@ public class PropertyMapperTests {
@Test
public
void
whenTrueWhenValueIsTrueShouldMap
()
{
Boolean
result
=
this
.
map
.
from
(
true
).
whenTrue
().
toInstance
(
Boolean:
:
new
);
Boolean
result
=
this
.
map
.
from
(
true
).
whenTrue
().
toInstance
(
Boolean:
:
valueOf
);
assertThat
(
result
).
isTrue
();
}
...
...
@@ -127,7 +127,7 @@ public class PropertyMapperTests {
@Test
public
void
whenFalseWhenValueIsFalseShouldMap
()
{
Boolean
result
=
this
.
map
.
from
(
false
).
whenFalse
().
toInstance
(
Boolean:
:
new
);
Boolean
result
=
this
.
map
.
from
(
false
).
whenFalse
().
toInstance
(
Boolean:
:
valueOf
);
assertThat
(
result
).
isFalse
();
}
...
...
@@ -148,7 +148,7 @@ public class PropertyMapperTests {
@Test
public
void
whenHasTextWhenValueHasTextShouldMap
()
{
Integer
result
=
this
.
map
.
from
(
123
).
whenHasText
().
toInstance
(
Integer:
:
new
);
Integer
result
=
this
.
map
.
from
(
123
).
whenHasText
().
toInstance
(
Integer:
:
valueOf
);
assertThat
(
result
).
isEqualTo
(
123
);
}
...
...
@@ -191,7 +191,7 @@ public class PropertyMapperTests {
public
void
whenWhenCombinedWithAsUsesSourceValue
()
{
Count
<
String
>
source
=
new
Count
<>(()
->
"123"
);
Long
result
=
this
.
map
.
from
(
source
).
when
(
"123"
::
equals
).
as
(
Integer:
:
valueOf
)
.
when
((
v
)
->
v
==
123
).
as
(
Integer:
:
longValue
).
toInstance
(
Long:
:
new
);
.
when
((
v
)
->
v
==
123
).
as
(
Integer:
:
longValue
).
toInstance
(
Long:
:
valueOf
);
assertThat
(
result
).
isEqualTo
(
123
);
assertThat
(
source
.
getCount
()).
isOne
();
}
...
...
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