use of com.google.gerrit.extensions.api.changes.ReviewerInput in project gerrit by GerritCodeReview.
the class AbstractQueryChangesTest method reviewerAndCcByEmailWithQueryForDifferentUser.
@Test
public void reviewerAndCcByEmailWithQueryForDifferentUser() throws Exception {
Project.NameKey project = Project.nameKey("repo");
TestRepository<Repo> repo = createProject(project.get());
ConfigInput conf = new ConfigInput();
conf.enableReviewerByEmail = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(conf);
String userByEmail = "John Doe <un.registered@reviewer.com>";
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
ReviewerInput rin = new ReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new ReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
assertQuery("reviewer:\"someone@example.com\"");
assertQuery("cc:\"someone@example.com\"");
}
use of com.google.gerrit.extensions.api.changes.ReviewerInput in project gerrit by GerritCodeReview.
the class AbstractQueryChangesTest method reviewerAndCc.
@Test
public void reviewerAndCc() throws Exception {
Account.Id user1 = createAccount("user1");
TestRepository<Repo> repo = createProject("repo");
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
Change change3 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
ReviewerInput rin = new ReviewerInput();
rin.reviewer = user1.toString();
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new ReviewerInput();
rin.reviewer = user1.toString();
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
assertQuery("is:reviewer");
assertQuery("reviewer:self");
gApi.changes().id(change3.getChangeId()).current().review(ReviewInput.recommend());
assertQuery("is:reviewer", change3);
assertQuery("reviewer:self", change3);
requestContext.setContext(newRequestContext(user1));
assertQuery("reviewer:" + user1, change1);
assertQuery("cc:" + user1, change2);
assertQuery("is:cc", change2);
assertQuery("cc:self", change2);
}
Aggregations