WiserAssertions: apply rule ReturnCount
This commit is contained in:
parent
97d67cb557
commit
cef89074ef
1 changed files with 8 additions and 4 deletions
|
@ -181,16 +181,20 @@ public final class WiserAssertions {
|
||||||
private String getMimeMessageBody(final WiserMessage message)
|
private String getMimeMessageBody(final WiserMessage message)
|
||||||
throws IOException, MessagingException {
|
throws IOException, MessagingException {
|
||||||
Object content = getMimeMessage(message).getContent();
|
Object content = getMimeMessage(message).getContent();
|
||||||
|
String result = null;
|
||||||
if (content instanceof String) {
|
if (content instanceof String) {
|
||||||
return (String) content;
|
result = (String) content;
|
||||||
}
|
}
|
||||||
if (content instanceof MimeMessage) {
|
if (content instanceof MimeMessage) {
|
||||||
return content.toString();
|
result = content.toString();
|
||||||
}
|
}
|
||||||
if (content instanceof MimeMultipart) {
|
if (content instanceof MimeMultipart) {
|
||||||
return getMimeMultipartAsString((MimeMultipart) content);
|
result = getMimeMultipartAsString((MimeMultipart) content);
|
||||||
}
|
}
|
||||||
throw new RuntimeException("Unexpected MimeMessage content");
|
if (result == null) {
|
||||||
|
throw new RuntimeException("Unexpected MimeMessage content");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue