@Test public void matchShouldReturnEmptyWhenSenderHasNoRRT() throws Exception { Collection<MailAddress> result = testee.match(FakeMail.builder() .name("name") .sender(SENDER) .recipient(RECIPIENT1) .build()); assertThat(result).isEmpty(); }
@Override public Collection<MailAddress> match(Mail mail) { try { if (mail.hasSender()) { recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain()); } } catch (RecipientRewriteTable.TooManyMappingException e) { return mail.getRecipients(); } catch (Exception e) { LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT"); } return ImmutableList.of(); }
IsSenderInRRTLoop extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { try { if (mail.hasSender()) { recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain()); } } catch (RecipientRewriteTable.TooManyMappingException e) { return mail.getRecipients(); } catch (Exception e) { LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT"); } return ImmutableList.of(); } }
IsSenderInRRTLoop extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { try { if (mail.hasSender()) { recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain()); } } catch (RecipientRewriteTable.TooManyMappingException e) { return mail.getRecipients(); } catch (Exception e) { LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT"); } return ImmutableList.of(); } @Inject  IsSenderInRRTLoop(RecipientRewriteTable recipientRewriteTable); }
IsSenderInRRTLoop extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { try { if (mail.hasSender()) { recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain()); } } catch (RecipientRewriteTable.TooManyMappingException e) { return mail.getRecipients(); } catch (Exception e) { LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT"); } return ImmutableList.of(); } @Inject  IsSenderInRRTLoop(RecipientRewriteTable recipientRewriteTable); @Override Collection<MailAddress> match(Mail mail); }
IsSenderInRRTLoop extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { try { if (mail.hasSender()) { recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain()); } } catch (RecipientRewriteTable.TooManyMappingException e) { return mail.getRecipients(); } catch (Exception e) { LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT"); } return ImmutableList.of(); } @Inject  IsSenderInRRTLoop(RecipientRewriteTable recipientRewriteTable); @Override Collection<MailAddress> match(Mail mail);  }