From e434ee17cae196b2beb767a17d2cdb20b711f6b1 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 7 Apr 2026 22:20:03 -0700 Subject: [PATCH] Fix WebFlux test Timezone issue Fix test that fails in certain timezones. See gh-8923 --- .../webflux/autoconfigure/WebFluxAutoConfigurationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java index 6eb10ac2724..60e2b39b853 100644 --- a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java +++ b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java @@ -343,11 +343,11 @@ class WebFluxAutoConfigurationTests { } @Test - void embeddedValueResolverIsAppliedToConversionService() throws Exception { + void embeddedValueResolverIsAppliedToConversionService() { this.contextRunner.withPropertyValues("my.date.format=yyyy-MM-dd").run((context) -> { FormattingConversionService conversionService = context.getBean(FormattingConversionService.class); TypeDescriptor dateType = new TypeDescriptor(FormattedDate.class.getDeclaredField("date")); - Date date = Date.from(ZonedDateTime.of(2000, 1, 2, 3, 4, 5, 6, ZoneId.of("UTC")).toInstant()); + Date date = Date.from(ZonedDateTime.of(2000, 1, 2, 3, 4, 5, 6, ZoneId.systemDefault()).toInstant()); assertThat(conversionService.convert(date, dateType, TypeDescriptor.valueOf(String.class))) .isEqualTo("2000-01-02"); });