TestAccount: rename getEmailAddress() to getNameEmail()

The getEmailAddress() returns "name <login@host>" while an email
address is often interpreted as "login@host"

Change-Id: Icf4d825d1618dea547f546d83af724bfe210da9d
This commit is contained in:
Han-Wen Nienhuys
2020-02-25 17:22:45 +01:00
parent 813f3aa62a
commit 419eaec4cf
14 changed files with 47 additions and 46 deletions

View File

@@ -1282,7 +1282,7 @@ public abstract class AbstractDaemonTest {
}
protected void assertNotifyCc(TestAccount expected) {
assertNotifyCc(expected.getEmailAddress());
assertNotifyCc(expected.getNameEmail());
}
protected void assertNotifyCc(String expectedEmail, String expectedFullname) {
@@ -1302,7 +1302,7 @@ public abstract class AbstractDaemonTest {
protected void assertNotifyBcc(TestAccount expected) {
assertThat(sender.getMessages()).hasSize(1);
Message m = sender.getMessages().get(0);
assertThat(m.rcpt()).containsExactly(expected.getEmailAddress());
assertThat(m.rcpt()).containsExactly(expected.getNameEmail());
assertThat(m.headers().get("To").isEmpty()).isTrue();
assertThat(m.headers().get("Cc").isEmpty()).isTrue();
}

View File

@@ -79,7 +79,7 @@ public abstract class TestAccount {
.toString();
}
public Address getEmailAddress() {
public Address getNameEmail() {
// Address is weird enough that it's safer and clearer to create a new instance in a
// non-abstract method rather than, say, having an abstract emailAddress() as part of this
// AutoValue class. Specifically: