@Test public void createMessageWithBadSource() { Throwable exception = assertThrows(MessagingException.class, () -> { this.mimeMessageFactory.createMessage("source", null); }); assertEquals("Failed to create mime message from source [class java.lang.String]", exception.getMessage()); }
@Override public MimeMessage createMessage(Object source, Map<String, Object> parameters) throws MessagingException { if (!(source instanceof MimeMessage)) { throw new MessagingException( String.format("Failed to create mime message from source [%s]", source.getClass())); } return new ExtendedMimeMessage((MimeMessage) source); }
MessageMimeMessageFactory extends AbstractMimeMessageFactory<MimeMessage> { @Override public MimeMessage createMessage(Object source, Map<String, Object> parameters) throws MessagingException { if (!(source instanceof MimeMessage)) { throw new MessagingException( String.format("Failed to create mime message from source [%s]", source.getClass())); } return new ExtendedMimeMessage((MimeMessage) source); } }
MessageMimeMessageFactory extends AbstractMimeMessageFactory<MimeMessage> { @Override public MimeMessage createMessage(Object source, Map<String, Object> parameters) throws MessagingException { if (!(source instanceof MimeMessage)) { throw new MessagingException( String.format("Failed to create mime message from source [%s]", source.getClass())); } return new ExtendedMimeMessage((MimeMessage) source); }  }
MessageMimeMessageFactory extends AbstractMimeMessageFactory<MimeMessage> { @Override public MimeMessage createMessage(Object source, Map<String, Object> parameters) throws MessagingException { if (!(source instanceof MimeMessage)) { throw new MessagingException( String.format("Failed to create mime message from source [%s]", source.getClass())); } return new ExtendedMimeMessage((MimeMessage) source); }  @Override MimeMessage createMessage(Object source, Map<String, Object> parameters); }
MessageMimeMessageFactory extends AbstractMimeMessageFactory<MimeMessage> { @Override public MimeMessage createMessage(Object source, Map<String, Object> parameters) throws MessagingException { if (!(source instanceof MimeMessage)) { throw new MessagingException( String.format("Failed to create mime message from source [%s]", source.getClass())); } return new ExtendedMimeMessage((MimeMessage) source); }  @Override MimeMessage createMessage(Object source, Map<String, Object> parameters);  }