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