Skip to content

Commit

Permalink
Merge pull request #27568 from geoand/jackson-date-polish
Browse files Browse the repository at this point in the history
Replace deprecated Date constructor use in Jackson test
  • Loading branch information
gsmet authored Aug 29, 2022
2 parents fac6d3e + db07302 commit 4ea1c65
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package io.quarkus.jackson.deployment;

import java.util.Calendar;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

import javax.inject.Inject;
Expand All @@ -25,7 +28,8 @@ public class JacksonTimeZonePropertiesTest {

@Test
public void testTimezone() throws JsonProcessingException {
Assertions.assertThat(objectMapper.writeValueAsString(new Pojo(new Date(2021, Calendar.MARCH, 3, 11, 5))))
Assertions.assertThat(objectMapper.writeValueAsString(new Pojo(Date.from(
ZonedDateTime.of(LocalDateTime.of(2021, Month.MARCH, 3, 11, 5), ZoneId.of("GMT")).toInstant()))))
.contains("+07");
}

Expand Down

0 comments on commit 4ea1c65

Please sign in to comment.