MimeMessageHelperExt extends MimeMessageHelper { public void setHeaderReturnReceipt(String emailToNotification) throws MessagingException { getMimeMessage().setHeader(HEADER_RETURN_RECEIPT, emailToNotification); } MimeMessageHelperExt(MimeMessage mimeMessage);  MimeMessageHelperExt(MimeMessage mimeMessage, String encoding);  MimeMessageHelperExt(MimeMessage mimeMessage, boolean multipart);  MimeMessageHelperExt(MimeMessage mimeMessage, boolean multipart, String encoding);  MimeMessageHelperExt(MimeMessage mimeMessage, int multipartMode);  MimeMessageHelperExt(MimeMessage mimeMessage, int multipartMode, String encoding); void setHeaderReturnReceipt(String emailToNotification); void setHeaderDepositionNotificationTo(String emailToNotification);  }
@Test public void shouldSetHeaderReturnReceipt() throws Exception { MimeMessageHelperExt mimeMessageHelperExt = new MimeMessageHelperExt(mimeMessage); String expectedReturnReceipt = "marco-tullio@roma.aeterna"; mimeMessageHelperExt.setHeaderReturnReceipt(expectedReturnReceipt); verify(mimeMessage).setHeader(HEADER_RETURN_RECEIPT, expectedReturnReceipt); }