use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USER_NoFullNameUser.
@Test
public void USER_NoFullNameUser() {
setFrom("USER");
final String email = "a.u.thor@test.example.com";
final Account.Id user = user(null, email);
final Address r = create().from(user);
assertThat(r).isNotNull();
assertThat(r.name()).isNull();
assertThat(r.email()).isEqualTo(email);
verifyAccountCacheGet(user);
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method USERNoAllowDomain.
@Test
public void USERNoAllowDomain() {
setFrom("USER");
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 SERVER_FullyConfiguredUser.
@Test
public void SERVER_FullyConfiguredUser() {
setFrom("SERVER");
final String name = "A U. Thor";
final String email = "a.u.thor@test.example.com";
final Account.Id user = userNoLookup(name, email);
final Address r = create().from(user);
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 CUSTOM_NullUser.
@Test
public void CUSTOM_NullUser() {
setFrom("A ${user} B <my.server@email.address>");
final Address r = create().from(null);
assertThat(r).isNotNull();
assertThat(r.name()).isEqualTo(ident.getName());
assertThat(r.email()).isEqualTo("my.server@email.address");
}
use of com.google.gerrit.entities.Address in project gerrit by GerritCodeReview.
the class FromAddressGeneratorProviderTest method MIXED_FullyConfiguredUser.
@Test
public void MIXED_FullyConfiguredUser() {
setFrom("MIXED");
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 + " (Code Review)");
assertThat(r.email()).isEqualTo(ident.getEmailAddress());
verifyAccountCacheGet(user);
}
Aggregations