@Test public void givenDate_shouldSerialize() throws ParseException, JsonProcessingException { String expectedJson = "1514160000000"; String actualJson = new ObjectMapper().writeValueAsString(new AllDateTypes().getDate()); assertThat(actualJson).isEqualTo(expectedJson); }
public Date getDate() { return date; }
AllDateTypes { public Date getDate() { return date; } }
AllDateTypes { public Date getDate() { return date; } AllDateTypes(); }
AllDateTypes { public Date getDate() { return date; } AllDateTypes(); Date getDate(); void setDate(Date date); LocalDate getLocalDate(); void setLocalDate(LocalDate localDate); LocalDateTime getLocalDateTime(); void setLocalDateTime(LocalDateTime localDateTime); DayOfWeek getDayOfWeek(); void setDayOfWeek(DayOfWeek dayOfWeek); LocalTime getLocalTime(); void setLocalTime(LocalTime localTime); ZoneId getZoneId(); void setZoneId(ZoneId zoneId); ZonedDateTime getZonedDateTime(); void setZonedDateTime(ZonedDateTime zonedDateTime); ZoneOffset getOffset(); void setOffset(ZoneOffset offset); OffsetDateTime getOffsetDateTime(); void setOffsetDateTime(OffsetDateTime offsetDateTime); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
AllDateTypes { public Date getDate() { return date; } AllDateTypes(); Date getDate(); void setDate(Date date); LocalDate getLocalDate(); void setLocalDate(LocalDate localDate); LocalDateTime getLocalDateTime(); void setLocalDateTime(LocalDateTime localDateTime); DayOfWeek getDayOfWeek(); void setDayOfWeek(DayOfWeek dayOfWeek); LocalTime getLocalTime(); void setLocalTime(LocalTime localTime); ZoneId getZoneId(); void setZoneId(ZoneId zoneId); ZonedDateTime getZonedDateTime(); void setZonedDateTime(ZonedDateTime zonedDateTime); ZoneOffset getOffset(); void setOffset(ZoneOffset offset); OffsetDateTime getOffsetDateTime(); void setOffsetDateTime(OffsetDateTime offsetDateTime); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }