@Test public void givenLocalTime_shouldSerialize() throws ParseException, JsonProcessingException { String expectedJson = "{\"hour\":23,\"minute\":0,\"second\":0,\"nano\":0}"; String actualJson = new ObjectMapper().writeValueAsString(new AllDateTypes().getLocalTime()); assertThat(actualJson).isEqualTo(expectedJson); }
public LocalTime getLocalTime() { return localTime; }
AllDateTypes { public LocalTime getLocalTime() { return localTime; } }
AllDateTypes { public LocalTime getLocalTime() { return localTime; } AllDateTypes(); }
AllDateTypes { public LocalTime getLocalTime() { return localTime; } 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 LocalTime getLocalTime() { return localTime; } 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();  }