@Test public void testProvidedDateIsConvertedToUTC() throws Exception { ByteArrayInputStream in = new ByteArrayInputStream(TEST_EMAIL_WITH_TIMEZONE.getBytes()); Email email = new Email(in, false); assertNotNull(email.getSentDate()); assertThat(email.getHeader("Date", null), endsWith("-0700")); email.updateHeaders(); assertNotNull(email.getSentDate()); assertThat(email.getHeader("Date", null), endsWith("+0000 (GMT)")); }
@Test public void testDefaultDateIsUTC() throws Exception { Email email = new Email(true); assertNull(email.getSentDate()); email.updateHeaders(); assertNotNull(email.getSentDate()); assertThat(email.getHeader("Date", null), endsWith("+0000 (GMT)")); }