Skip to content

Commit f96a688

Browse files
committed
Polish "Allow DurationFormat and PeriodFormat to be used on parameters"
See gh-22646
1 parent 914452b commit f96a688

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,8 @@ void loadWhenBindingToConstructorParametersWithNotMatchingCustomDurationFormatSh
833833
source.put("test.duration", "P12D");
834834
sources.addLast(new MapPropertySource("test", source));
835835
assertThatExceptionOfType(Exception.class)
836-
.isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).satisfies((ex) -> {
837-
assertThat(ex).hasCauseInstanceOf(BindException.class);
838-
});
836+
.isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).havingCause()
837+
.isInstanceOf(BindException.class);
839838
}
840839

841840
@Test
@@ -845,9 +844,8 @@ void loadWhenBindingToConstructorParametersWithNotMatchingCustomPeriodFormatShou
845844
source.put("test.period", "P12D");
846845
sources.addLast(new MapPropertySource("test", source));
847846
assertThatExceptionOfType(Exception.class)
848-
.isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).satisfies((ex) -> {
849-
assertThat(ex).hasCauseInstanceOf(BindException.class);
850-
});
847+
.isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).havingCause()
848+
.isInstanceOf(BindException.class);
851849
}
852850

853851
@Test

0 commit comments

Comments
 (0)