@Test public void subjectWithPrefixShouldReturnAbsentWhenEmptyPrefix() throws Exception { MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties())); message.setSubject("original subject"); FakeMail oldMail = FakeMail.from(message); String subjectPrefix = ""; String subject = null; Optional<String> subjectWithPrefix = new MimeMessageUtils(message).subjectWithPrefix(subjectPrefix, oldMail, subject); assertThat(subjectWithPrefix).isEmpty(); }
public Optional<String> subjectWithPrefix(String subjectPrefix) throws MessagingException { return prefixSubject(message.getSubject(), subjectPrefix); }
MimeMessageUtils { public Optional<String> subjectWithPrefix(String subjectPrefix) throws MessagingException { return prefixSubject(message.getSubject(), subjectPrefix); } }
MimeMessageUtils { public Optional<String> subjectWithPrefix(String subjectPrefix) throws MessagingException { return prefixSubject(message.getSubject(), subjectPrefix); } MimeMessageUtils(MimeMessage message); }
MimeMessageUtils { public Optional<String> subjectWithPrefix(String subjectPrefix) throws MessagingException { return prefixSubject(message.getSubject(), subjectPrefix); } MimeMessageUtils(MimeMessage message); Optional<String> subjectWithPrefix(String subjectPrefix); Optional<String> subjectWithPrefix(String subjectPrefix, Mail originalMail, String subject); String getMessageHeaders(); List<Header> toHeaderList(); }
MimeMessageUtils { public Optional<String> subjectWithPrefix(String subjectPrefix) throws MessagingException { return prefixSubject(message.getSubject(), subjectPrefix); } MimeMessageUtils(MimeMessage message); Optional<String> subjectWithPrefix(String subjectPrefix); Optional<String> subjectWithPrefix(String subjectPrefix, Mail originalMail, String subject); String getMessageHeaders(); List<Header> toHeaderList();  }