support create PR review in single API call & remove @Preview

This commit is contained in:
Sébastien Lesaint
2017-12-04 11:11:58 +01:00
parent 6961c467a6
commit e74346fed6
5 changed files with 217 additions and 132 deletions

View File

@@ -33,7 +33,7 @@ public class PullRequestTest extends AbstractGitHubApiTestBase {
public void testPullRequestReviews() throws Exception {
String name = rnd.next();
GHPullRequest p = getRepository().createPullRequest(name, "stable", "master", "## test");
GHPullRequestReview draftReview = p.createReview("Some draft review", null,
GHPullRequestReviewDraft draftReview = p.newDraftReview(null, "Some draft review",
GHPullRequestReviewComment.draft("Some niggle", "changelog.html", 1)
);
assertThat(draftReview.getState(), is(GHPullRequestReviewState.PENDING));
@@ -45,15 +45,15 @@ public class PullRequestTest extends AbstractGitHubApiTestBase {
assertThat(review.getState(), is(GHPullRequestReviewState.PENDING));
assertThat(review.getBody(), is("Some draft review"));
assertThat(review.getCommitId(), notNullValue());
review.submit("Some review comment", GHPullRequestReviewEvent.COMMENT);
draftReview.submit("Some review comment", GHPullRequestReviewEvent.COMMENT);
List<GHPullRequestReviewComment> comments = review.listReviewComments().asList();
assertEquals(1, comments.size());
GHPullRequestReviewComment comment = comments.get(0);
assertEquals("Some niggle", comment.getBody());
review = p.createReview("Some new review", null,
draftReview = p.newDraftReview(null, "Some new review",
GHPullRequestReviewComment.draft("Some niggle", "changelog.html", 1)
);
review.delete();
draftReview.delete();
}
@Test