use of com.google.gerrit.extensions.common.AccountInfo in project gerrit by GerritCodeReview.
the class ChangeReviewersByEmailIT method reviewerAndCCReceiveRegularNotification.
@Test
public void reviewerAndCCReceiveRegularNotification() throws Exception {
AccountInfo acc = new AccountInfo("Foo Bar", "foo.bar@gerritcodereview.com");
for (ReviewerState state : ImmutableList.of(ReviewerState.CC, ReviewerState.REVIEWER)) {
PushOneCommit.Result r = createChange();
ReviewerInput input = new ReviewerInput();
input.reviewer = toRfcAddressString(acc);
input.state = state;
gApi.changes().id(r.getChangeId()).addReviewer(input);
sender.clear();
gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(ReviewInput.approve());
assertNotifyCc(Address.parse(input.reviewer));
}
}
use of com.google.gerrit.extensions.common.AccountInfo in project gerrit by GerritCodeReview.
the class ChangeReviewersIT method addExistingCcShortCircuits.
@Test
public void addExistingCcShortCircuits() throws Exception {
PushOneCommit.Result r = createChange();
ReviewerInput input = new ReviewerInput();
input.reviewer = user.email();
input.state = ReviewerState.CC;
ReviewerResult result = gApi.changes().id(r.getChangeId()).addReviewer(input);
assertThat(result.ccs).hasSize(1);
AccountInfo info = result.ccs.get(0);
assertThat(info._accountId).isEqualTo(user.id().get());
assertThat(gApi.changes().id(r.getChangeId()).addReviewer(input).ccs).isEmpty();
}
use of com.google.gerrit.extensions.common.AccountInfo in project gerrit by GerritCodeReview.
the class AbstractQueryAccountsTest method asAnonymous.
@Test
public void asAnonymous() throws Exception {
AccountInfo user1 = newAccount("user1");
setAnonymous();
assertQuery("9999999");
assertQuery("self");
assertQuery("username:" + user1.username, user1);
}
use of com.google.gerrit.extensions.common.AccountInfo in project gerrit by GerritCodeReview.
the class AbstractQueryAccountsTest method byCansee.
@Test
public void byCansee() throws Exception {
String domain = name("test.com");
AccountInfo user1 = newAccountWithEmail("account1", "account1@" + domain);
AccountInfo user2 = newAccountWithEmail("account2", "account2@" + domain);
AccountInfo user3 = newAccountWithEmail("account3", "account3@" + domain);
Project.NameKey p = createProject(name("p"));
ChangeInfo c = createChange(p);
assertQuery("name:" + domain + " cansee:" + c.changeId, user1, user2, user3);
GroupInfo group = createGroup(name("group"), user1, user2);
blockRead(p, group);
assertQuery("name:" + domain + " cansee:" + c.changeId, user3);
}
use of com.google.gerrit.extensions.common.AccountInfo in project gerrit by GerritCodeReview.
the class AbstractQueryAccountsTest method withStart.
@Test
public void withStart() throws Exception {
String domain = name("test.com");
AccountInfo user1 = newAccountWithEmail("user1", "user1@" + domain);
AccountInfo user2 = newAccountWithEmail("user2", "user2@" + domain);
AccountInfo user3 = newAccountWithEmail("user3", "user3@" + domain);
List<AccountInfo> result = assertQuery(domain, user1, user2, user3);
assertQuery(newQuery(domain).withStart(1), result.subList(1, 3));
}
Aggregations