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


Java PullRequest.getId方法代码示例

本文整理汇总了Java中org.eclipse.egit.github.core.PullRequest.getId方法的典型用法代码示例。如果您正苦于以下问题:Java PullRequest.getId方法的具体用法?Java PullRequest.getId怎么用?Java PullRequest.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.egit.github.core.PullRequest的用法示例。


在下文中一共展示了PullRequest.getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPullRequestCommentProducer

import org.eclipse.egit.github.core.PullRequest; //导入方法依赖的package包/类
@Test
public void testPullRequestCommentProducer() throws Exception {
    PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestCommentProducer");
    latestPullRequestId = pullRequest.getId();

    Endpoint commentProducerEndpoint = getMandatoryEndpoint("direct:validPullRequest");
    Exchange exchange = commentProducerEndpoint.createExchange();
    String commentText = "Pushed this comment at " + new Date();
    exchange.getIn().setBody(commentText);
    template.send(commentProducerEndpoint, exchange);

    Thread.sleep(1 * 1000);

    // Verify that the mock pull request service received this comment.
    List<CommitComment> commitComments = pullRequestService.getComments(null, (int) pullRequest.getId());
    assertEquals(1, commitComments.size());
    CommitComment commitComment = commitComments.get(0);
    assertEquals("Commit IDs did not match ", Long.toString(pullRequest.getId()), commitComment.getCommitId());
    assertEquals("Comment text did not match ", commentText, commitComment.getBodyText());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:PullRequestCommentProducerTest.java

示例2: testPullRequestCommentProducer

import org.eclipse.egit.github.core.PullRequest; //导入方法依赖的package包/类
@Test
public void testPullRequestCommentProducer() throws Exception {
    // Create a pull request
    PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestCommentProducer");
    latestPullRequestId = pullRequest.getId();


    // Close it
    Endpoint closePullRequestEndpoint = getMandatoryEndpoint(PULL_REQUEST_PRODUCER_ENDPOINT);
    Exchange exchange = closePullRequestEndpoint.createExchange();
    template.send(closePullRequestEndpoint, exchange);

    Thread.sleep(1 * 1000);

    // Verify that it was closed

    List<PullRequest> closedPullRequests = pullRequestService.getPullRequests(null, "closed");
    assertNotNull(closedPullRequests);
    boolean found = false;
    for (PullRequest pr : closedPullRequests) {
        if (pr.getId() == latestPullRequestId) {
            found = true;
            break;
        }
    }

    assertTrue("Didn't find pull request " + latestPullRequestId, found);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:29,代码来源:ClosePullRequestProducerTest.java


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