JAMES-1900 anonimizing addresses in HeaderCollectionTest
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/f34b6fe6 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f34b6fe6 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f34b6fe6 Branch: refs/heads/master Commit: f34b6fe6586bf2127d9e7ff5ae51f60ad127dc47 Parents: ff33b0c Author: benwa <btell...@linagora.com> Authored: Thu May 4 15:01:17 2017 +0700 Committer: benwa <btell...@linagora.com> Committed: Thu May 4 16:37:04 2017 +0700 ---------------------------------------------------------------------- .../json/HeaderCollectionTest.java | 48 ++++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/f34b6fe6/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java ---------------------------------------------------------------------- diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java index 69ebc6f..88efd00 100644 --- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java +++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java @@ -32,52 +32,52 @@ public class HeaderCollectionTest { @Test public void simpleValueAddressHeaderShouldBeAddedToTheAddressSet() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("To", "btell...@linagora.com")) + .add(new FieldImpl("To", "ben.tell...@linagora.com")) .build(); assertThat(headerCollection.getToAddressSet()) - .containsOnly(new EMailer("btell...@linagora.com", "btell...@linagora.com")); + .containsOnly(new EMailer("ben.tell...@linagora.com", "ben.tell...@linagora.com")); } @Test public void comaSeparatedAddressShouldBeBothAddedToTheAddressSet() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("To", "btell...@linagora.com, be...@minet.net")) + .add(new FieldImpl("To", "ben.tell...@linagora.com, btell...@minet.net")) .build(); assertThat(headerCollection.getToAddressSet()) .containsOnly( - new EMailer("btell...@linagora.com", "btell...@linagora.com"), - new EMailer("be...@minet.net", "be...@minet.net")); + new EMailer("ben.tell...@linagora.com", "ben.tell...@linagora.com"), + new EMailer("btell...@minet.net", "btell...@minet.net")); } @Test public void addressesOfTwoFieldsHavingTheSameNameShouldBeMerged() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("To", "btell...@linagora.com")) - .add(new FieldImpl("To", "btell...@linagora.com, be...@minet.net")) + .add(new FieldImpl("To", "ben.tell...@linagora.com")) + .add(new FieldImpl("To", "ben.tell...@linagora.com, btell...@minet.net")) .build(); assertThat(headerCollection.getToAddressSet()) .containsOnly( - new EMailer("btell...@linagora.com", "btell...@linagora.com"), - new EMailer("be...@minet.net", "be...@minet.net")); + new EMailer("ben.tell...@linagora.com", "ben.tell...@linagora.com"), + new EMailer("btell...@minet.net", "btell...@minet.net")); } @Test public void displayNamesShouldBeRetreived() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("To", "Christophe Hamerling <chamerl...@linagora.com>")) + .add(new FieldImpl("To", "Christophe Hamerling <chri.hamerl...@linagora.com>")) .build(); assertThat(headerCollection.getToAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com")); } @Test public void displayNamesShouldBeRetrievedWhenEncodedWord() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("From", "=?UTF-8?B?RnLDqWTDqXJpYyBNQVJUSU4=?= <fmar...@linagora.com>, Graham CROSMARIE <gcrosma...@linagora.com>")) + .add(new FieldImpl("From", "=?UTF-8?B?RnLDqWTDqXJpYyBNQVJUSU4=?= <fred.mar...@linagora.com>, Graham CROSMARIE <grah.crosma...@linagora.com>")) .build(); assertThat(headerCollection.getFromAddressSet()) @@ -88,54 +88,54 @@ public class HeaderCollectionTest { @Test public void addressWithTwoDisplayNamesOnTheSameFieldShouldBeRetrieved() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("From", "Christophe Hamerling <chamerl...@linagora.com>, Graham CROSMARIE <gcrosma...@linagora.com>")) + .add(new FieldImpl("From", "Christophe Hamerling <chri.hamerl...@linagora.com>, Graham CROSMARIE <grah.crosma...@linagora.com>")) .build(); assertThat(headerCollection.getFromAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com"), - new EMailer("Graham CROSMARIE", "gcrosma...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com"), + new EMailer("Graham CROSMARIE", "grah.crosma...@linagora.com")); } @Test public void mixingAddressWithDisplayNamesWithOthersShouldBeAllowed() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("To", "Christophe Hamerling <chamerl...@linagora.com>, gcrosma...@linagora.com")) + .add(new FieldImpl("To", "Christophe Hamerling <chri.hamerl...@linagora.com>, grah.crosma...@linagora.com")) .build(); assertThat(headerCollection.getToAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com"), - new EMailer("gcrosma...@linagora.com", "gcrosma...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com"), + new EMailer("grah.crosma...@linagora.com", "grah.crosma...@linagora.com")); } @Test public void displayNamesShouldBeRetreivedOnCc() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("Cc", "Christophe Hamerling <chamerl...@linagora.com>")) + .add(new FieldImpl("Cc", "Christophe Hamerling <chri.hamerl...@linagora.com>")) .build(); assertThat(headerCollection.getCcAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com")); } @Test public void displayNamesShouldBeRetreivedOnReplyTo() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("Reply-To", "Christophe Hamerling <chamerl...@linagora.com>")) + .add(new FieldImpl("Reply-To", "Christophe Hamerling <chri.hamerl...@linagora.com>")) .build(); assertThat(headerCollection.getReplyToAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com")); } @Test public void displayNamesShouldBeRetreivedOnBcc() { HeaderCollection headerCollection = HeaderCollection.builder() - .add(new FieldImpl("Bcc", "Christophe Hamerling <chamerl...@linagora.com>")) + .add(new FieldImpl("Bcc", "Christophe Hamerling <chri.hamerl...@linagora.com>")) .build(); assertThat(headerCollection.getBccAddressSet()) - .containsOnly(new EMailer("Christophe Hamerling", "chamerl...@linagora.com")); + .containsOnly(new EMailer("Christophe Hamerling", "chri.hamerl...@linagora.com")); } @Test --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org