コード例 #1
0
ファイル: HostIsTest.java プロジェクト: apache/james-project
  @Before
  public void setUp() throws Exception {
    matcher = new HostIs();
    FakeMatcherConfig mci =
        FakeMatcherConfig.builder().matcherName("HostIs").condition(JAMES_APACHE_ORG).build();

    matcher.init(mci);
  }
コード例 #2
0
ファイル: HostIsTest.java プロジェクト: apache/james-project
  @Test
  public void shouldNotMatchWhenWrongDomain() throws MessagingException {
    Mail mail = FakeMail.builder().recipients(ANY_AT_JAMES2, OTHER_AT_JAMES2).build();

    assertThat(matcher.match(mail)).isEmpty();
  }
コード例 #3
0
ファイル: HostIsTest.java プロジェクト: apache/james-project
  @Test
  public void shouldMatchOnlyWhenRightDomain() throws MessagingException {
    Mail mail = FakeMail.builder().recipients(ANY_AT_JAMES, ANY_AT_JAMES2).build();

    assertThat(matcher.match(mail)).containsExactly(ANY_AT_JAMES);
  }