Skip to content

Commit

Permalink
using customized from email address
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Aug 4, 2020
1 parent 1642d51 commit 7737c8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SimpleEmailServiceSpec extends Specification {
SimpleEmailService service = new DefaultSimpleEmailService(
simpleEmailService,
new SimpleEmailServiceConfiguration(
sourceEmail: Optional.of('vlad@agorapulse.com'),
sourceEmail: Optional.of('Vladimir Orany <vlad@agorapulse.com>'),
subjectPrefix: Optional.of('[TEST]')
)
)
Expand Down Expand Up @@ -158,7 +158,7 @@ class SimpleEmailServiceSpec extends Specification {
deliveryIndicator == EmailDeliveryStatus.STATUS_BLACKLISTED

simpleEmailService.sendEmail(_) >> { SendEmailRequest request ->
request.source() == 'vlad@agorapulse.com'
request.source() == 'Vladimir Orany <vlad@agorapulse.com>'
request.message().subject().data().startsWith('[TEST] ')
throw AwsServiceException.builder().message('Address blacklisted').build()
}
Expand Down Expand Up @@ -205,7 +205,7 @@ class SimpleEmailServiceSpec extends Specification {
deliveryIndicator == EmailDeliveryStatus.STATUS_DELIVERED

simpleEmailService.sendRawEmail(_) >> { SendRawEmailRequest request ->
request.source() == 'vlad@agorapulse.com'
request.source() == 'Vladimir Orany <vlad@agorapulse.com>'
return SendRawEmailResponse.builder().messageId('foobar').build()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SimpleEmailServiceSpec extends Specification {

@Subject
SimpleEmailService service = new DefaultSimpleEmailService(simpleEmailService, new SimpleEmailServiceConfiguration(
sourceEmail: Optional.of('vlad@agorapulse.com'),
sourceEmail: Optional.of('Vladimir Orany <vlad@agorapulse.com>'),
subjectPrefix: Optional.of('[TEST]')
))

Expand Down Expand Up @@ -156,7 +156,7 @@ class SimpleEmailServiceSpec extends Specification {
deliveryIndicator == EmailDeliveryStatus.STATUS_BLACKLISTED

simpleEmailService.sendEmail(_) >> { SendEmailRequest request ->
assert request.source == 'vlad@agorapulse.com'
assert request.source == 'Vladimir Orany <vlad@agorapulse.com>'
assert request.message.subject.data.startsWith('[TEST] ')
throw new AmazonServiceException('Address blacklisted')
}
Expand Down Expand Up @@ -198,7 +198,7 @@ class SimpleEmailServiceSpec extends Specification {
deliveryIndicator == EmailDeliveryStatus.STATUS_DELIVERED

simpleEmailService.sendRawEmail(_) >> { SendRawEmailRequest request ->
assert request.source == 'vlad@agorapulse.com'
assert request.source == 'Vladimir Orany <vlad@agorapulse.com>'
return new SendRawEmailResult().withMessageId('foobar')
}
}
Expand Down

0 comments on commit 7737c8e

Please sign in to comment.