@Test public void getUniqueMessageId() throws Exception { ExtendedMimeMessage message = new ExtendedMimeMessage(); message.setText(TEST_CONTENT); message.setMessageId(TEST_MESSAGE_ID); assertThat(message.getUniqueMessageId(), equalTo("wmK5jlxm4kPv2caEGeVtsDOT3zk=")); message.setRecipients(Message.RecipientType.TO, "john.doe@example.com"); assertThat(message.getUniqueMessageId(), equalTo("g9tEjV2+qAGNIFaQ44+P+iZtZZw=")); message.setMessageId("AnotherID"); assertThat(message.getUniqueMessageId(), equalTo("hdr6yyK2Tq9fKpv5hr5eMOL8XYA=")); message.setMessageId(TEST_MESSAGE_ID); assertThat(message.getUniqueMessageId(), equalTo("g9tEjV2+qAGNIFaQ44+P+iZtZZw=")); }
public String getUniqueMessageId() { if (uniqueMessageId == null) { try { StringBuilder sb = new StringBuilder(getNotNullMessageId()); String recipients = InternetAddress.toString(getAllRecipients()); if (recipients != null) { sb.append(':').append(recipients); } uniqueMessageId = digest(sb.toString()); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while computing a unique id for a MimeMessage", e); } } return uniqueMessageId; }
ExtendedMimeMessage extends MimeMessage { public String getUniqueMessageId() { if (uniqueMessageId == null) { try { StringBuilder sb = new StringBuilder(getNotNullMessageId()); String recipients = InternetAddress.toString(getAllRecipients()); if (recipients != null) { sb.append(':').append(recipients); } uniqueMessageId = digest(sb.toString()); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while computing a unique id for a MimeMessage", e); } } return uniqueMessageId; } }
ExtendedMimeMessage extends MimeMessage { public String getUniqueMessageId() { if (uniqueMessageId == null) { try { StringBuilder sb = new StringBuilder(getNotNullMessageId()); String recipients = InternetAddress.toString(getAllRecipients()); if (recipients != null) { sb.append(':').append(recipients); } uniqueMessageId = digest(sb.toString()); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while computing a unique id for a MimeMessage", e); } } return uniqueMessageId; } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); }
ExtendedMimeMessage extends MimeMessage { public String getUniqueMessageId() { if (uniqueMessageId == null) { try { StringBuilder sb = new StringBuilder(getNotNullMessageId()); String recipients = InternetAddress.toString(getAllRecipients()); if (recipients != null) { sb.append(':').append(recipients); } uniqueMessageId = digest(sb.toString()); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while computing a unique id for a MimeMessage", e); } } return uniqueMessageId; } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); static ExtendedMimeMessage wrap(MimeMessage message); boolean isEmpty(); void setType(String mailType); String getType(); void setMessageId(String messageId); boolean ensureSaved(); @Override void setHeader(String name, String value); String getUniqueMessageId(); }
ExtendedMimeMessage extends MimeMessage { public String getUniqueMessageId() { if (uniqueMessageId == null) { try { StringBuilder sb = new StringBuilder(getNotNullMessageId()); String recipients = InternetAddress.toString(getAllRecipients()); if (recipients != null) { sb.append(':').append(recipients); } uniqueMessageId = digest(sb.toString()); } catch (MessagingException e) { throw new RuntimeException("Unexpected exception while computing a unique id for a MimeMessage", e); } } return uniqueMessageId; } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); static ExtendedMimeMessage wrap(MimeMessage message); boolean isEmpty(); void setType(String mailType); String getType(); void setMessageId(String messageId); boolean ensureSaved(); @Override void setHeader(String name, String value); String getUniqueMessageId();  }