ReformatDateService extends ReformatMetadata { public void setDestinationFormatBuilder(DateFormatBuilder destinationFormatBuilder) { this.destinationFormatBuilder = destinationFormatBuilder; } ReformatDateService();  ReformatDateService(String regexp);  ReformatDateService(String regexp, DateFormatBuilder srcFormat, DateFormatBuilder destFormat); @Override String reformat(String s, AdaptrisMessage msg); DateFormatBuilder getSourceFormatBuilder(); void setSourceFormatBuilder(DateFormatBuilder sourceFormatBuilder); DateFormatBuilder getDestinationFormatBuilder(); void setDestinationFormatBuilder(DateFormatBuilder destinationFormatBuilder);  }
@Test public void testService_DestFormat_SecondsEpoch() throws Exception { ReformatDateService service = new ReformatDateService(); service.setDestinationFormatBuilder(new DateFormatBuilder(DateFormatUtil.CustomDateFormat.SECONDS_SINCE_EPOCH.name())); service.setMetadataKeyRegexp(DATE_METADATA_KEY); AdaptrisMessage msg = createMessage(); execute(service, msg); assertTrue(msg.containsKey(DATE_METADATA_KEY)); assertTrue(msg.getMetadataValue(DATE_METADATA_KEY).matches(REGEXP_DEST_DATE_NUMERIC)); }
@Test public void testService_DestFormat_MillisecondsEpoch() throws Exception { ReformatDateService service = new ReformatDateService(); service.setDestinationFormatBuilder(new DateFormatBuilder(DateFormatUtil.CustomDateFormat.MILLISECONDS_SINCE_EPOCH.name())); service.setMetadataKeyRegexp(DATE_METADATA_KEY); AdaptrisMessage msg = createMessage(); execute(service, msg); assertTrue(msg.containsKey(DATE_METADATA_KEY)); assertTrue(msg.getMetadataValue(DATE_METADATA_KEY).matches(REGEXP_DEST_DATE_NUMERIC)); }