@Test public void ensureMessageReceiveSameMessageID() throws Exception { MimeMessage source = new MimeMessage(Session.getInstance(new Properties())); source.setText("Content"); MimeMessage first = this.mimeMessageFactory.createMessage(source, null); MimeMessage second = this.mimeMessageFactory.createMessage(source, null); assertThat(first.getMessageID(), notNullValue()); assertThat(second.getMessageID(), notNullValue()); assertThat(first.getMessageID(), equalTo(second.getMessageID())); }
@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);  }