当前位置: 首页>>代码示例>>Java>>正文


Java ChangeApi.addReviewer方法代码示例

本文整理汇总了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);
}
 
开发者ID:uwolfer,项目名称:gerrit-rest-java-client,代码行数:18,代码来源:ChangeApiRestClientTest.java

示例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);
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_owners,代码行数:15,代码来源:ReviewerManager.java

示例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);
}
 
开发者ID:uwolfer,项目名称:gerrit-rest-java-client,代码行数:14,代码来源:ChangeApiRestClientTest.java

示例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);
  }
}
 
开发者ID:davido,项目名称:gerrit-reviewers-plugin,代码行数:17,代码来源:DefaultReviewers.java


注:本文中的com.google.gerrit.extensions.api.changes.ChangeApi.addReviewer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。