Use 'example.com' domain for emails in tests
'test.com' is a real domain and shouldn't be used for email addresses in
tests. 'example.com' and 'example.net' are a domains reserved for use in
documentation and tests, hence we should use these.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ie4b6673e1e73e91a9d7c6e9288048ea2a5593624
diff --git a/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java b/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java
index 0cd6182..3c1bc2f 100644
--- a/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java
@@ -1221,7 +1221,7 @@
@Test
public void cannotAddNonConfirmedEmailWithoutModifyAccountPermission() throws Exception {
TestAccount account = accountCreator.create(name("user"));
- EmailInput input = newEmailInput("test@test.com");
+ EmailInput input = newEmailInput("test@example.com");
requestScopeOperations.setApiUser(user.id());
assertThrows(AuthException.class, () -> gApi.accounts().id(account.username()).addEmail(input));
}
diff --git a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java
index 744035e..39a860e 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java
@@ -1878,7 +1878,7 @@
Timestamp oldTs = rsrc.getChange().getLastUpdatedOn();
// create a group named "ab" with one user: testUser
- String email = "abcd@test.com";
+ String email = "abcd@example.com";
String fullname = "abcd";
Account.Id accountIdOfTestUser =
accountOperations
@@ -1931,11 +1931,11 @@
accountOperations
.newAccount()
.username("kobebryant")
- .preferredEmail("kobebryant@test.com")
+ .preferredEmail("kobebryant@example.com")
.fullname(testUserFullname)
.create();
- String myGroupUserEmail = "lee@test.com";
+ String myGroupUserEmail = "lee@example.com";
String myGroupUserFullname = "lee";
Account.Id accountIdOfGroupUser =
accountOperations
@@ -3747,7 +3747,7 @@
"Configure Notifications",
"project.config",
"[notify \"my=notify-config\"]\n"
- + " email = foo@test.com\n"
+ + " email = foo@example.com\n"
+ " filter = dir:\\\"foo/bar/baz\\\"");
push.to(RefNames.REFS_CONFIG);
testRepo.reset(oldHead);
@@ -3759,7 +3759,8 @@
admin.newIdent(), testRepo, "Test change", "foo/bar/baz/test.txt", "some content");
PushOneCommit.Result r = push.to("refs/for/master");
assertThat(sender.getMessages()).hasSize(1);
- assertThat(sender.getMessages().get(0).rcpt()).containsExactly(Address.parse("foo@test.com"));
+ assertThat(sender.getMessages().get(0).rcpt())
+ .containsExactly(Address.parse("foo@example.com"));
// Comment on the change.
sender.clear();
@@ -3767,7 +3768,8 @@
reviewInput.message = "some message";
gApi.changes().id(r.getChangeId()).current().review(reviewInput);
assertThat(sender.getMessages()).hasSize(1);
- assertThat(sender.getMessages().get(0).rcpt()).containsExactly(Address.parse("foo@test.com"));
+ assertThat(sender.getMessages().get(0).rcpt())
+ .containsExactly(Address.parse("foo@example.com"));
}
@Test
diff --git a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
index 7a80cbd..a9114b9 100644
--- a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
@@ -279,7 +279,7 @@
sender.clear();
// watch project as user2
- TestAccount user2 = accountCreator.create("user2", "user2@test.com", "User2", null);
+ TestAccount user2 = accountCreator.create("user2", "user2@example.com", "User2", null);
requestScopeOperations.setApiUser(user2.id());
watch(watchedProject);
@@ -391,7 +391,7 @@
sender.clear();
// watch project as user2
- TestAccount user2 = accountCreator.create("user2", "user2@test.com", "User2", null);
+ TestAccount user2 = accountCreator.create("user2", "user2@example.com", "User2", null);
requestScopeOperations.setApiUser(user2.id());
watch(anyProject);
@@ -528,7 +528,7 @@
// watch project as user that can view all private change
TestAccount userThatCanViewPrivateChanges =
accountCreator.create(
- "user2", "user2@test.com", "User2", null, groupThatCanViewPrivateChanges.name);
+ "user2", "user2@example.com", "User2", null, groupThatCanViewPrivateChanges.name);
requestScopeOperations.setApiUser(userThatCanViewPrivateChanges.id());
watch(watchedProject);
diff --git a/javatests/com/google/gerrit/server/mail/send/FromAddressGeneratorProviderTest.java b/javatests/com/google/gerrit/server/mail/send/FromAddressGeneratorProviderTest.java
index a383d56..03129ae 100644
--- a/javatests/com/google/gerrit/server/mail/send/FromAddressGeneratorProviderTest.java
+++ b/javatests/com/google/gerrit/server/mail/send/FromAddressGeneratorProviderTest.java
@@ -146,9 +146,9 @@
@Test
public void USERNoAllowDomain() {
setFrom("USER");
- setDomains(Arrays.asList("example.com"));
+ setDomains(Arrays.asList("example.net"));
final String name = "A U. Thor";
- final String email = "a.u.thor@test.com";
+ final String email = "a.u.thor@example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
@@ -161,10 +161,10 @@
@Test
public void USERAllowDomainTwice() {
setFrom("USER");
+ setDomains(Arrays.asList("example.net"));
setDomains(Arrays.asList("example.com"));
- setDomains(Arrays.asList("test.com"));
final String name = "A U. Thor";
- final String email = "a.u.thor@test.com";
+ final String email = "a.u.thor@example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
@@ -177,10 +177,10 @@
@Test
public void USERAllowDomainTwiceReverse() {
setFrom("USER");
- setDomains(Arrays.asList("test.com"));
setDomains(Arrays.asList("example.com"));
+ setDomains(Arrays.asList("example.net"));
final String name = "A U. Thor";
- final String email = "a.u.thor@test.com";
+ final String email = "a.u.thor@example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
@@ -193,9 +193,9 @@
@Test
public void USERAllowTwoDomains() {
setFrom("USER");
- setDomains(Arrays.asList("example.com", "test.com"));
+ setDomains(Arrays.asList("example.com", "example.net"));
final String name = "A U. Thor";
- final String email = "a.u.thor@test.com";
+ final String email = "a.u.thor@example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
diff --git a/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java b/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
index 59f2b6d..f5c9628 100644
--- a/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
+++ b/javatests/com/google/gerrit/server/query/account/AbstractQueryAccountsTest.java
@@ -217,7 +217,7 @@
AccountInfo user5 = newAccountWithEmail("user5", name("user5MixedCase@example.com"));
- assertQuery("notexisting@test.com");
+ assertQuery("notexisting@example.com");
assertQuery(currentUserInfo.email, currentUserInfo);
assertQuery("email:" + currentUserInfo.email, currentUserInfo);
@@ -253,8 +253,8 @@
@Test
public void byEmailWithoutModifyAccountCapability() throws Exception {
- String preferredEmail = name("primary@test.com");
- String secondaryEmail = name("secondary@test.com");
+ String preferredEmail = name("primary@example.com");
+ String secondaryEmail = name("secondary@example.com");
AccountInfo user1 = newAccountWithEmail("user1", preferredEmail);
addEmails(user1, secondaryEmail);
@@ -485,11 +485,11 @@
// sorting by account ID. Use the same fullname for all accounts so that sorting must be done by
// preferred email.
AccountInfo userFoo3 =
- newAccount("user3", "foo-" + appendix, "foo3-" + appendix + "@test.com", true);
+ newAccount("user3", "foo-" + appendix, "foo3-" + appendix + "@example.com", true);
AccountInfo userFoo1 =
- newAccount("user1", "foo-" + appendix, "foo1-" + appendix + "@test.com", true);
+ newAccount("user1", "foo-" + appendix, "foo1-" + appendix + "@example.com", true);
AccountInfo userFoo2 =
- newAccount("user2", "foo-" + appendix, "foo2-" + appendix + "@test.com", true);
+ newAccount("user2", "foo-" + appendix, "foo2-" + appendix + "@example.com", true);
assertThat(userFoo3._accountId).isLessThan(userFoo1._accountId);
assertThat(userFoo1._accountId).isLessThan(userFoo2._accountId);