@Test(expected = MessagingException.class) public void testGetMultipartException() throws MessagingException, IOException { final MimeMessage msg = context.mock(MimeMessage.class); context.checking(new Expectations() { { allowing(msg).getContent(); will(throwException(new IOException())); } }); sut.getMultipart(msg); context.assertIsSatisfied(); }
protected Multipart getMultipart(final Message message) throws MessagingException { try { return (Multipart) message.getContent(); } catch (IOException ex) { throw new MessagingException("Failed to retrieve multipart from message being built.", ex); } }
EmailerFactory { protected Multipart getMultipart(final Message message) throws MessagingException { try { return (Multipart) message.getContent(); } catch (IOException ex) { throw new MessagingException("Failed to retrieve multipart from message being built.", ex); } } }
EmailerFactory { protected Multipart getMultipart(final Message message) throws MessagingException { try { return (Multipart) message.getContent(); } catch (IOException ex) { throw new MessagingException("Failed to retrieve multipart from message being built.", ex); } } EmailerFactory(final String inMailTransportProtocol, final Map<String, String> inTransportConfiguration,
            final String inDefaultFromAddress); }
EmailerFactory { protected Multipart getMultipart(final Message message) throws MessagingException { try { return (Multipart) message.getContent(); } catch (IOException ex) { throw new MessagingException("Failed to retrieve multipart from message being built.", ex); } } EmailerFactory(final String inMailTransportProtocol, final Map<String, String> inTransportConfiguration,
            final String inDefaultFromAddress); static String buildEmailList(final Iterable< ? extends HasEmail> list); void sendMail(final Message message); MimeMessage createMessage(); void setTo(final MimeMessage message, final String emailToString); void setCc(final MimeMessage message, final String emailToString); void setBcc(final MimeMessage message, final String emailToString); void setFrom(final MimeMessage message, final String emailFromString); void setReplyTo(final MimeMessage message, final String addressString); void setSubject(final MimeMessage message, final String subject); void setTextBody(final MimeMessage message, final String textBody); void setHtmlBody(final MimeMessage message, final String htmlBody); Part addAttachmentPart(final Message message); Part addAttachmentMessage(final Message message, final Message attachedMessage); }
EmailerFactory { protected Multipart getMultipart(final Message message) throws MessagingException { try { return (Multipart) message.getContent(); } catch (IOException ex) { throw new MessagingException("Failed to retrieve multipart from message being built.", ex); } } EmailerFactory(final String inMailTransportProtocol, final Map<String, String> inTransportConfiguration,
            final String inDefaultFromAddress); static String buildEmailList(final Iterable< ? extends HasEmail> list); void sendMail(final Message message); MimeMessage createMessage(); void setTo(final MimeMessage message, final String emailToString); void setCc(final MimeMessage message, final String emailToString); void setBcc(final MimeMessage message, final String emailToString); void setFrom(final MimeMessage message, final String emailFromString); void setReplyTo(final MimeMessage message, final String addressString); void setSubject(final MimeMessage message, final String subject); void setTextBody(final MimeMessage message, final String textBody); void setHtmlBody(final MimeMessage message, final String htmlBody); Part addAttachmentPart(final Message message); Part addAttachmentMessage(final Message message, final Message attachedMessage);  }