From f96a688c1b7fe8473e3f2f05dc3656b7f405bc15 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 30 Jul 2020 09:34:26 +0100 Subject: [PATCH] Polish "Allow DurationFormat and PeriodFormat to be used on parameters" See gh-22646 --- .../properties/ConfigurationPropertiesTests.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index 346e773326..02c50d9181 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -833,9 +833,8 @@ class ConfigurationPropertiesTests { source.put("test.duration", "P12D"); sources.addLast(new MapPropertySource("test", source)); assertThatExceptionOfType(Exception.class) - .isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).satisfies((ex) -> { - assertThat(ex).hasCauseInstanceOf(BindException.class); - }); + .isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).havingCause() + .isInstanceOf(BindException.class); } @Test @@ -845,9 +844,8 @@ class ConfigurationPropertiesTests { source.put("test.period", "P12D"); sources.addLast(new MapPropertySource("test", source)); assertThatExceptionOfType(Exception.class) - .isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).satisfies((ex) -> { - assertThat(ex).hasCauseInstanceOf(BindException.class); - }); + .isThrownBy(() -> load(ConstructorParameterWithFormatConfiguration.class)).havingCause() + .isInstanceOf(BindException.class); } @Test