ZonedDateTimeDeserializer extends JsonDeserializer<ZonedDateTime> { @Override public ZonedDateTime deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException { return ZonedDateTime.parse(p.getText()); }  @Override ZonedDateTime deserialize(final JsonParser p, final DeserializationContext ctxt);  }
@Test public void shouldDeserializeZonedDateTime() throws IOException { when(jsonParser.getText()).thenReturn("2017-10-19T16:10:00.000+02:00[Europe/Berlin]"); final ZonedDateTime expectedDateTime = ZonedDateTime.of(2017,10,19,16,10,0,0, ZoneId.of("Europe/Berlin")); final ZonedDateTime deserialized = zonedDateTimeDeserializer.deserialize(jsonParser, null); assertThat(deserialized, is(expectedDateTime)); }