From bae1d8d7804e2eaa5b5966238791f8b9a604b675 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 30 Jan 2020 08:20:49 +0100 Subject: [PATCH] Polish "Use new AssertJ duration assertions" See gh-19985 --- .../web/reactive/WebTestClientAutoConfigurationTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 b02347af0d..94d4913cc3 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)); }); }