mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Fix WebFlux test Timezone issue
Fix test that fails in certain timezones. See gh-8923
This commit is contained in:
+2
-2
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user