@Test public void getToShouldReturnEmptyWhenMailetToContainsOnlyRecipients() throws Exception { when(mailet.getTo()) .thenReturn(ImmutableList.of(SpecialAddress.RECIPIENTS.toInternetAddress())); FakeMail fakeMail = FakeMail.defaultFakeMail(); List<MailAddress> to = testee.getTo(fakeMail); assertThat(to).isEmpty(); }
public List<MailAddress> getTo(Mail originalMail) throws MessagingException { List<InternetAddress> apparentlyTo = mailet.getTo(); if (!apparentlyTo.isEmpty()) { if (containsOnlyUnalteredOrTo(apparentlyTo)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceInternetAddresses(originalMail, apparentlyTo); } return ImmutableList.of(); }
TosUtils { public List<MailAddress> getTo(Mail originalMail) throws MessagingException { List<InternetAddress> apparentlyTo = mailet.getTo(); if (!apparentlyTo.isEmpty()) { if (containsOnlyUnalteredOrTo(apparentlyTo)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceInternetAddresses(originalMail, apparentlyTo); } return ImmutableList.of(); } }
TosUtils { public List<MailAddress> getTo(Mail originalMail) throws MessagingException { List<InternetAddress> apparentlyTo = mailet.getTo(); if (!apparentlyTo.isEmpty()) { if (containsOnlyUnalteredOrTo(apparentlyTo)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceInternetAddresses(originalMail, apparentlyTo); } return ImmutableList.of(); } private  TosUtils(RedirectNotify mailet); }
TosUtils { public List<MailAddress> getTo(Mail originalMail) throws MessagingException { List<InternetAddress> apparentlyTo = mailet.getTo(); if (!apparentlyTo.isEmpty()) { if (containsOnlyUnalteredOrTo(apparentlyTo)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceInternetAddresses(originalMail, apparentlyTo); } return ImmutableList.of(); } private  TosUtils(RedirectNotify mailet); static TosUtils from(RedirectNotify mailet); List<MailAddress> getTo(Mail originalMail); }
TosUtils { public List<MailAddress> getTo(Mail originalMail) throws MessagingException { List<InternetAddress> apparentlyTo = mailet.getTo(); if (!apparentlyTo.isEmpty()) { if (containsOnlyUnalteredOrTo(apparentlyTo)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceInternetAddresses(originalMail, apparentlyTo); } return ImmutableList.of(); } private  TosUtils(RedirectNotify mailet); static TosUtils from(RedirectNotify mailet); List<MailAddress> getTo(Mail originalMail);  }