@Test public void getTypeWhenException() { Throwable exception = assertThrows(RuntimeException.class, () -> { ExtendedMimeMessage message = new ThrowingeExtendedMimeMessage(); message.getType(); }); assertEquals("Failed to get Type header", exception.getMessage()); assertEquals("MessagingException: error", ExceptionUtils.getRootCauseMessage(exception)); }
public String getType() { try { return getHeader(XMAIL_TYPE_HEADER, null); } catch (MessagingException e) { throw new RuntimeException("Failed to get Type header", e); } }
ExtendedMimeMessage extends MimeMessage { public String getType() { try { return getHeader(XMAIL_TYPE_HEADER, null); } catch (MessagingException e) { throw new RuntimeException("Failed to get Type header", e); } } }
ExtendedMimeMessage extends MimeMessage { public String getType() { try { return getHeader(XMAIL_TYPE_HEADER, null); } catch (MessagingException e) { throw new RuntimeException("Failed to get Type header", e); } } ExtendedMimeMessage();  ExtendedMimeMessage(Session session, InputStream is);  ExtendedMimeMessage(MimeMessage source); }
ExtendedMimeMessage extends MimeMessage { public String getType() { try { return getHeader(XMAIL_TYPE_HEADER, null); } catch (MessagingException e) { throw new RuntimeException("Failed to get Type header", e); } } 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 getType() { try { return getHeader(XMAIL_TYPE_HEADER, null); } catch (MessagingException e) { throw new RuntimeException("Failed to get Type header", e); } } 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();  }