@Test public void serializeNull() throws IOException { serializer.serialize( null, jsonGenerator, serializerProvider ); Mockito.verify( jsonGenerator ).writeNull(); Mockito.verifyNoMoreInteractions( jsonGenerator ); }
@Override public void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ) throws IOException { if ( zonedDateTime == null ) { jsonGenerator.writeNull(); } else { jsonGenerator.writeString( zonedDateTime.format( DateTimeFormatter.ISO_OFFSET_DATE_TIME ) ); } }
ZonedDateTimeSerializer extends StdSerializer<ZonedDateTime> { @Override public void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ) throws IOException { if ( zonedDateTime == null ) { jsonGenerator.writeNull(); } else { jsonGenerator.writeString( zonedDateTime.format( DateTimeFormatter.ISO_OFFSET_DATE_TIME ) ); } } }
ZonedDateTimeSerializer extends StdSerializer<ZonedDateTime> { @Override public void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ) throws IOException { if ( zonedDateTime == null ) { jsonGenerator.writeNull(); } else { jsonGenerator.writeString( zonedDateTime.format( DateTimeFormatter.ISO_OFFSET_DATE_TIME ) ); } } ZonedDateTimeSerializer(); }
ZonedDateTimeSerializer extends StdSerializer<ZonedDateTime> { @Override public void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ) throws IOException { if ( zonedDateTime == null ) { jsonGenerator.writeNull(); } else { jsonGenerator.writeString( zonedDateTime.format( DateTimeFormatter.ISO_OFFSET_DATE_TIME ) ); } } ZonedDateTimeSerializer(); @Override void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ); }
ZonedDateTimeSerializer extends StdSerializer<ZonedDateTime> { @Override public void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider ) throws IOException { if ( zonedDateTime == null ) { jsonGenerator.writeNull(); } else { jsonGenerator.writeString( zonedDateTime.format( DateTimeFormatter.ISO_OFFSET_DATE_TIME ) ); } } ZonedDateTimeSerializer(); @Override void serialize( ZonedDateTime zonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider );  }