Skip to content

Commit b43718c

Browse files
locationguru-kedarjoshisnicoll
authored andcommitted
1 parent ecb7e24 commit b43718c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void fromValue() {
5050
@Test
5151
public void fromValueAsIntShouldAdaptValue() {
5252
Integer result = this.map.from("123").asInt(Long::valueOf)
53-
.toInstance(Integer::new);
53+
.toInstance(Integer::valueOf);
5454
assertThat(result).isEqualTo(123);
5555
}
5656

@@ -84,7 +84,7 @@ public void toShouldMapFromSupplier() {
8484
@Test
8585
public void asIntShouldAdaptSupplier() {
8686
Integer result = this.map.from(() -> "123").asInt(Long::valueOf)
87-
.toInstance(Integer::new);
87+
.toInstance(Integer::valueOf);
8888
assertThat(result).isEqualTo(123);
8989
}
9090

@@ -116,7 +116,7 @@ public void whenNonNullWhenSuppliedThrowsNullPointerExceptionShouldNotMap() {
116116

117117
@Test
118118
public void whenTrueWhenValueIsTrueShouldMap() {
119-
Boolean result = this.map.from(true).whenTrue().toInstance(Boolean::new);
119+
Boolean result = this.map.from(true).whenTrue().toInstance(Boolean::valueOf);
120120
assertThat(result).isTrue();
121121
}
122122

@@ -127,7 +127,7 @@ public void whenTrueWhenValueIsFalseShouldNotMap() {
127127

128128
@Test
129129
public void whenFalseWhenValueIsFalseShouldMap() {
130-
Boolean result = this.map.from(false).whenFalse().toInstance(Boolean::new);
130+
Boolean result = this.map.from(false).whenFalse().toInstance(Boolean::valueOf);
131131
assertThat(result).isFalse();
132132
}
133133

@@ -148,7 +148,7 @@ public void whenHasTextWhenValueIsEmptyShouldNotMap() {
148148

149149
@Test
150150
public void whenHasTextWhenValueHasTextShouldMap() {
151-
Integer result = this.map.from(123).whenHasText().toInstance(Integer::new);
151+
Integer result = this.map.from(123).whenHasText().toInstance(Integer::valueOf);
152152
assertThat(result).isEqualTo(123);
153153
}
154154

@@ -191,7 +191,7 @@ public void whenWhenValueDoesNotMatchShouldNotMap() {
191191
public void whenWhenCombinedWithAsUsesSourceValue() {
192192
Count<String> source = new Count<>(() -> "123");
193193
Long result = this.map.from(source).when("123"::equals).as(Integer::valueOf)
194-
.when((v) -> v == 123).as(Integer::longValue).toInstance(Long::new);
194+
.when((v) -> v == 123).as(Integer::longValue).toInstance(Long::valueOf);
195195
assertThat(result).isEqualTo(123);
196196
assertThat(source.getCount()).isOne();
197197
}

0 commit comments

Comments
 (0)