Use string constant like other previews

This commit is contained in:
Kohsuke Kawaguchi
2017-09-09 07:59:31 -07:00
parent aebbe86cfc
commit ad28ca4a90
3 changed files with 10 additions and 5 deletions

View File

@@ -32,6 +32,8 @@ import java.util.Date;
import java.util.List;
import javax.annotation.CheckForNull;
import static org.kohsuke.github.Previews.BLACK_CAT;
/**
* A pull request.
*
@@ -234,7 +236,7 @@ public class GHPullRequest extends GHIssue {
return new PagedIterable<GHPullRequestReview>() {
public PagedIterator<GHPullRequestReview> _iterator(int pageSize) {
return new PagedIterator<GHPullRequestReview>(root.retrieve()
.withPreview("application/vnd.github.black-cat-preview+json")
.withPreview(BLACK_CAT)
.asIterator(String.format("%s/reviews", getApiRoute()),
GHPullRequestReview[].class, pageSize)) {
@Override
@@ -308,7 +310,7 @@ public class GHPullRequest extends GHIssue {
.with("body", body)
//.with("event", event.name())
._with("comments", draftComments)
.withPreview("application/vnd.github.black-cat-preview+json")
.withPreview(BLACK_CAT)
.to(getApiRoute() + "/reviews", GHPullRequestReview.class).wrapUp(this);
}