diff --git a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java index 5387a811399..b6f3df9497f 100644 --- a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java +++ b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java @@ -512,11 +512,11 @@ class WebMvcAutoConfigurationTests { } @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"); });