/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ @Override public TimeZone getTimeZone() { return _config.getTimeZone(); }
@Test public void setTimeZoneWithInvalidZoneId() { this.factory.setTimeZone(TimeZone.getTimeZone("bogusZoneId")); this.factory.afterPropertiesSet(); TimeZone timeZone = TimeZone.getTimeZone("GMT"); assertEquals(timeZone, this.factory.getObject().getSerializationConfig().getTimeZone()); assertEquals(timeZone, this.factory.getObject().getDeserializationConfig().getTimeZone()); }
@Test public void timeZoneSetter() { TimeZone timeZone = TimeZone.getTimeZone("Europe/Paris"); ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().timeZone(timeZone).build(); assertEquals(timeZone, objectMapper.getSerializationConfig().getTimeZone()); assertEquals(timeZone, objectMapper.getDeserializationConfig().getTimeZone()); }
@Test public void timeZoneStringSetter() { String zoneId = "Europe/Paris"; ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().timeZone(zoneId).build(); TimeZone timeZone = TimeZone.getTimeZone(zoneId); assertEquals(timeZone, objectMapper.getSerializationConfig().getTimeZone()); assertEquals(timeZone, objectMapper.getDeserializationConfig().getTimeZone()); }
@Test public void setTimeZone() { TimeZone timeZone = TimeZone.getTimeZone("Europe/Paris"); this.factory.setTimeZone(timeZone); this.factory.afterPropertiesSet(); assertEquals(timeZone, this.factory.getObject().getSerializationConfig().getTimeZone()); assertEquals(timeZone, this.factory.getObject().getDeserializationConfig().getTimeZone()); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ public TimeZone getTimeZone() { return _config.getTimeZone(); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ public TimeZone getTimeZone() { return _config.getTimeZone(); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ public TimeZone getTimeZone() { return _config.getTimeZone(); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ @Override public TimeZone getTimeZone() { return _config.getTimeZone(); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ public TimeZone getTimeZone() { return _config.getTimeZone(); }
/** * Method for accessing default TimeZone to use: convenience method for *<pre> * getConfig().getTimeZone(); *</pre> */ @Override public TimeZone getTimeZone() { return _config.getTimeZone(); }