@@ -106,7 +106,7 @@ public void createMailSession_StandardDummyMailWithIdAndSendDate()
106
106
@ Test
107
107
public void createMailSession_OutlookMessageTest ()
108
108
throws IOException , MessagingException , ExecutionException , InterruptedException {
109
- Email email = assertSendingEmail (readOutlookMessage ("test-messages/HTML mail with replyto and attachment and embedded image.msg" ), false , false , false , false );
109
+ Email email = assertSendingEmail (readOutlookMessage ("test-messages/HTML mail with replyto and attachment and embedded image.msg" ), false , false , false , true );
110
110
verifyReceivedOutlookEmail (email , false , false );
111
111
}
112
112
@@ -115,7 +115,7 @@ public void createMailSession_OutlookMessageSmimeSignTest()
115
115
throws IOException , MessagingException , ExecutionException , InterruptedException {
116
116
EmailPopulatingBuilder builder = readOutlookMessage ("test-messages/HTML mail with replyto and attachment and embedded image.msg" );
117
117
builder .signWithSmime (new File (RESOURCES_PKCS + "/smime_keystore.pkcs12" ), "letmein" , "smime_test_user_alias" , "letmein" );
118
- Email email = assertSendingEmail (builder , false , true , false , false );
118
+ Email email = assertSendingEmail (builder , false , true , false , true );
119
119
verifyReceivedOutlookEmail (email , true , false );
120
120
121
121
EmailAssert .assertThat (email ).wasNotMergedWithSmimeSignedMessage ();
@@ -135,7 +135,7 @@ public void createMailSession_OutlookMessageSmimeEncryptTest()
135
135
throws IOException , MessagingException , ExecutionException , InterruptedException {
136
136
EmailPopulatingBuilder builder = readOutlookMessage ("test-messages/HTML mail with replyto and attachment and embedded image.msg" );
137
137
builder .encryptWithSmime (new File (RESOURCES_PKCS + "/smime_test_user.pem.standard.crt" ));
138
- Email email = assertSendingEmail (builder , false , true , false , false );
138
+ Email email = assertSendingEmail (builder , false , true , false , true );
139
139
verifyReceivedOutlookEmail (email , false , true );
140
140
141
141
EmailAssert .assertThat (email ).wasMergedWithSmimeSignedMessage ();
@@ -154,7 +154,7 @@ public void createMailSession_OutlookMessageSmimeSignEncryptTest()
154
154
EmailPopulatingBuilder builder = readOutlookMessage ("test-messages/HTML mail with replyto and attachment and embedded image.msg" );
155
155
builder .signWithSmime (new File (RESOURCES_PKCS + "/smime_keystore.pkcs12" ), "letmein" , "smime_test_user_alias" , "letmein" );
156
156
builder .encryptWithSmime (new File (RESOURCES_PKCS + "/smime_test_user.pem.standard.crt" ));
157
- Email email = assertSendingEmail (builder , false , true , false , false );
157
+ Email email = assertSendingEmail (builder , false , true , false , true );
158
158
verifyReceivedOutlookEmail (email , true , true );
159
159
160
160
EmailAssert .assertThat (email ).wasMergedWithSmimeSignedMessage ();
@@ -230,7 +230,7 @@ private void verifyReceivedOutlookEmail(final Email email, final boolean smimeSi
230
230
}
231
231
232
232
private Email assertSendingEmail (final EmailPopulatingBuilder originalEmailPopulatingBuilder , boolean compensateForDresscodeAttachmentNameOverrideErasure , boolean skipChecksDueToSmime ,
233
- boolean async , final boolean fixedSentDate )
233
+ boolean async , final boolean sentDateWasFixed )
234
234
throws MessagingException , ExecutionException , InterruptedException {
235
235
Email originalEmail = originalEmailPopulatingBuilder .buildEmail ();
236
236
@@ -250,12 +250,12 @@ private Email assertSendingEmail(final EmailPopulatingBuilder originalEmailPopul
250
250
251
251
Email receivedEmail = mimeMessageToEmail (receivedMimeMessage .getMimeMessage (), loadPkcs12KeyStore ());
252
252
253
- if (!fixedSentDate ) {
253
+ if (!sentDateWasFixed ) {
254
254
GregorianCalendar receiveWindowStart = new GregorianCalendar ();
255
255
receiveWindowStart .add (Calendar .SECOND , -5 );
256
256
assertThat (receivedEmail .getSentDate ()).isBetween (receiveWindowStart .getTime (), new Date ());
257
257
} else {
258
- assertThat (receivedEmail .getSentDate ()).isEqualTo (CUSTOM_SENT_DATE );
258
+ assertThat (receivedEmail .getSentDate ()).isEqualTo (originalEmailPopulatingBuilder . getSentDate () );
259
259
}
260
260
261
261
// ID will always be generated when sending: if set to a specific value, just assume the generated one
@@ -308,7 +308,7 @@ public void createMailSession_ReplyToMessage()
308
308
309
309
// send reply to initial mail
310
310
Email reply = EmailBuilder
311
- .replyingToAll (assertSendingEmail (receivedEmailPopulatingBuilder , false , false , false , false ))
311
+ .replyingToAll (assertSendingEmail (receivedEmailPopulatingBuilder , false , false , false , true ))
312
312
313
313
.withPlainText ("This is the reply" )
314
314
.buildEmail ();
@@ -340,7 +340,7 @@ public void createMailSession_ReplyToMessage_NotAll_AndCustomReferences()
340
340
341
341
// send reply to initial mail
342
342
Email reply = EmailBuilder
343
- .replyingTo (assertSendingEmail (receivedEmailPopulatingBuilder , false , false , false , false ))
343
+ .replyingTo (assertSendingEmail (receivedEmailPopulatingBuilder , false , false , false , true ))
344
344
.
from (
"Moo Shmoo" ,
"[email protected] " )
345
345
.withPlainText ("This is the reply" )
346
346
.buildEmail ();
0 commit comments