DatetimePickerFieldSerializer extends JsonSerializer<Temporal> { @Override public void serialize(final Temporal value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException { gen.writeString(serialize(value)); }  @Override void serialize(final Temporal value, final JsonGenerator gen, final SerializerProvider serializers);  }
@Test public void localTimeSerializeTest() throws Exception { assertThat(target.serialize(LocalTime.of(15, 52))) .isEqualTo("15:52"); }
@Test public void localDatetimeSerializeTest() throws Exception { assertThat(target.serialize(LocalDateTime.of(2017, 9, 8, 15, 52))) .isEqualToIgnoringCase("2017-09-08T15:52"); }
@Test public void unsupportedTypeSerializeTest() throws Exception { assertThatThrownBy(() -> { target.serialize(Instant.now()); }).isInstanceOf(IllegalArgumentException.class); }
@Test public void localDateSerializeTest() throws Exception { assertThat(target.serialize(LocalDate.of(2017, 9, 8))) .isEqualTo("2017-09-08"); }