### Question:
IsoLocalDateTimeSerializer extends JsonSerializer<LocalDateTime> { @Override public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeFieldName(IsoDateDeSerializer.DATE_NODE); gen.writeString(value.format(DateTimeFormatter.ISO_DATE_TIME)); gen.writeEndObject(); }  @Override void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers);  }### Answer:
@Test public void serialize() throws IOException { com.fasterxml.jackson.core.JsonGenerator jsonGenerator = mock(com.fasterxml.jackson.core.JsonGenerator.class); SerializerProvider serializerProvider = mock(SerializerProvider.class); LocalDateTime localDateTime = LocalDateTime.now(); new IsoLocalDateTimeSerializer().serialize(localDateTime, jsonGenerator, serializerProvider); verify(jsonGenerator).writeStartObject(); verify(jsonGenerator).writeFieldName("$date"); verify(jsonGenerator).writeString(localDateTime.format(DateTimeFormatter.ISO_DATE_TIME)); verify(jsonGenerator).writeEndObject(); verifyNoMoreInteractions(jsonGenerator); verifyZeroInteractions(serializerProvider); }