use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USER_NullUser.
@Test
public void USER_NullUser() {
setFrom("USER");
final Address r = create().from(null);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(ident.getName());
assertThat(r.email()).isEqualTo(ident.getEmailAddress());
verifyNoInteractions(accountCache);
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method MIXED_NoPreferredEmailUser.
@Test
public void MIXED_NoPreferredEmailUser() {
setFrom("MIXED");
final String name = "A U. Thor";
final Account.Id user = user(name, null);
final Address r = create().from(user);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(name + " (Code Review)");
assertThat(r.email()).isEqualTo(ident.getEmailAddress());
verifyAccountCacheGet(user);
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USERAllowDomainTwiceReverse.
@Test
public void USERAllowDomainTwiceReverse() {
setFrom("USER");
setDomains(Arrays.asList("example.com"));
setDomains(Arrays.asList("example.net"));
final String name = "A U. Thor";
final String email = "a.u.thor@example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(name + " (Code Review)");
assertThat(r.email()).isEqualTo(ident.getEmailAddress());
verifyAccountCacheGet(user);
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USER_NoPreferredEmailUser.
@Test
public void USER_NoPreferredEmailUser() {
setFrom("USER");
final String name = "A U. Thor";
final Account.Id user = user(name, null);
final Address r = create().from(user);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(name + " (Code Review)");
assertThat(r.email()).isEqualTo(ident.getEmailAddress());
verifyAccountCacheGet(user);
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USER_FullyConfiguredUser.
@Test
public void USER_FullyConfiguredUser() {
setFrom("USER");
final String name = "A U. Thor";
final String email = "a.u.thor@test.example.com";
final Account.Id user = user(name, email);
final Address r = create().from(user);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(name);
assertThat(r.email()).isEqualTo(email);
verifyAccountCacheGet(user);
}
Aggregations