diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java index b02347af0d4..94d4913cc39 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java @@ -74,8 +74,7 @@ class WebTestClientAutoConfigurationTests { this.contextRunner.withUserConfiguration(BaseConfiguration.class) .withPropertyValues("spring.test.webtestclient.timeout=15m").run((context) -> { WebTestClient webTestClient = context.getBean(WebTestClient.class); - Duration duration = (Duration) ReflectionTestUtils.getField(webTestClient, "timeout"); - assertThat(duration).hasMinutes(15); + assertThat(webTestClient).hasFieldOrPropertyWithValue("timeout", Duration.ofMinutes(15)); }); }