WiserAssertions.getMimeMessageBody: accept that content may be a String
Spring's SimpleMailMessage doesn't wrap it's email body in a mime content type as it is just a 'simple' mail message. Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
This commit is contained in:
parent
146f53e404
commit
eff6e6c0b3
1 changed files with 3 additions and 0 deletions
|
@ -181,6 +181,9 @@ public final class WiserAssertions {
|
|||
private String getMimeMessageBody(final WiserMessage message)
|
||||
throws IOException, MessagingException {
|
||||
Object content = getMimeMessage(message).getContent();
|
||||
if (content instanceof String) {
|
||||
return (String) content;
|
||||
}
|
||||
if (content instanceof MimeMessage) {
|
||||
return content.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue