From eff6e6c0b3874c32d9bfbb4f23cd29347552b437 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 16 Feb 2016 22:55:38 +0000 Subject: [PATCH] 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 --- .../java/net/kemitix/wiser/assertions/WiserAssertions.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/kemitix/wiser/assertions/WiserAssertions.java b/src/main/java/net/kemitix/wiser/assertions/WiserAssertions.java index 07d0c56..920adc5 100644 --- a/src/main/java/net/kemitix/wiser/assertions/WiserAssertions.java +++ b/src/main/java/net/kemitix/wiser/assertions/WiserAssertions.java @@ -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(); }