本文整理汇总了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());
}
示例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);
}