本文整理汇总了Java中com.google.gerrit.extensions.api.changes.ChangeApi.addReviewer方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeApi.addReviewer方法的具体用法?Java ChangeApi.addReviewer怎么用?Java ChangeApi.addReviewer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gerrit.extensions.api.changes.ChangeApi
的用法示例。
在下文中一共展示了ChangeApi.addReviewer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAddReviewer
import com.google.gerrit.extensions.api.changes.ChangeApi; //导入方法依赖的package包/类
@Test
public void testAddReviewer() throws Exception {
GerritRestClient gerritRestClient = getGerritRestClient(
"/changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers",
"{\"reviewer\":\"jdoe\",\"confirmed\":true}");
ChangesRestClient changesRestClient = getChangesRestClient(gerritRestClient);
ChangeApi changeApi = changesRestClient.id("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940");
AddReviewerInput input = new AddReviewerInput();
input.reviewer = "jdoe";
input.confirmed = true;
changeApi.addReviewer(input);
EasyMock.verify(gerritRestClient);
}
示例2: addReviewers
import com.google.gerrit.extensions.api.changes.ChangeApi; //导入方法依赖的package包/类
public void addReviewers(Change change, Collection<Account.Id> reviewers)
throws ReviewerManagerException {
try (ManualRequestContext ctx = requestContext.openAs(change.getOwner())) {
ChangeApi cApi = gApi.changes().id(change.getId().get());
for (Account.Id account : reviewers) {
cApi.addReviewer(account.toString());
}
} catch (RestApiException | OrmException e) {
log.error("Couldn't add reviewers to the change", e);
throw new ReviewerManagerException(e);
}
}
示例3: testAddReviewerWithStringParam
import com.google.gerrit.extensions.api.changes.ChangeApi; //导入方法依赖的package包/类
@Test
public void testAddReviewerWithStringParam() throws Exception {
GerritRestClient gerritRestClient = getGerritRestClient(
"/changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers",
"{\"reviewer\":\"jdoe\"}");
ChangesRestClient changesRestClient = getChangesRestClient(gerritRestClient);
ChangeApi changeApi = changesRestClient.id("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940");
changeApi.addReviewer("jdoe");
EasyMock.verify(gerritRestClient);
}
示例4: addReviewers
import com.google.gerrit.extensions.api.changes.ChangeApi; //导入方法依赖的package包/类
/**
* Append the reviewers to change#{@link Change}
*
* @param reviewers Set of reviewers to add
* @param change {@link Change} to add the reviewers to
*/
private void addReviewers(Set<Account> reviewers, Change change) {
try {
ChangeApi cApi = gApi.changes().id(change.getId().get());
for (Account account : reviewers) {
cApi.addReviewer(account.getId().toString());
}
} catch (RestApiException e) {
log.error("Couldn't add reviewers to the change", e);
}
}