WiserAssertions: convert messageBody content without using casting

Signed-off-by: Paul Campbell <paulcampbell@fife.ac.uk>
This commit is contained in:
Paul Campbell 2015-10-16 15:43:12 +01:00
parent 42b77c3565
commit c305cd4371

View file

@ -184,7 +184,7 @@ public final class WiserAssertions {
throws IOException, MessagingException {
Object content = getMimeMessage(message).getContent();
if (content instanceof MimeMessage) {
return (String) content;
return content.toString();
}
if (content instanceof MimeMultipart) {
return getMimeMultipartAsString((MimeMultipart) content);