Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Ander Peñalba2015-09-19 13:13:16 -0400
committerMatthias Sohn2015-09-24 16:49:47 -0400
commitd6d0679b5685f50c3c3634fa123c46fdced40698 (patch)
tree67de8c8b0ce0f451f1bb0700c57f38e6085d9831
parent9e5e4567cbb9497e7f2ee56cc6f45e7452eb032f (diff)
downloadegit-github-d6d0679b5685f50c3c3634fa123c46fdced40698.tar.gz
egit-github-d6d0679b5685f50c3c3634fa123c46fdced40698.tar.xz
egit-github-d6d0679b5685f50c3c3634fa123c46fdced40698.zip
Add 'action' and 'pullRequest' to PullRequestReviewCommentPayload
API specification: https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent Change-Id: I5277fdbb6cb7fc1690341501f408ca4e5d1ee4f5 Signed-off-by: Jon Ander Peñalba <jonan88@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestReviewCommentPayloadTest.java6
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java41
2 files changed, 47 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestReviewCommentPayloadTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestReviewCommentPayloadTest.java
index 1ccd514a..d7f9526c 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestReviewCommentPayloadTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestReviewCommentPayloadTest.java
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.eclipse.egit.github.core.CommitComment;
+import org.eclipse.egit.github.core.PullRequest;
import org.eclipse.egit.github.core.event.PullRequestReviewCommentPayload;
import org.junit.Test;
@@ -28,7 +29,9 @@ public class PullRequestReviewCommentPayloadTest {
@Test
public void defaultState() {
PullRequestReviewCommentPayload payload = new PullRequestReviewCommentPayload();
+ assertNull(payload.getAction());
assertNull(payload.getComment());
+ assertNull(payload.getPullRequest());
}
/**
@@ -38,6 +41,9 @@ public class PullRequestReviewCommentPayloadTest {
public void updateFields() {
PullRequestReviewCommentPayload payload = new PullRequestReviewCommentPayload();
CommitComment comment = new CommitComment();
+ PullRequest pullRequest = new PullRequest().setTitle("pull");
+ assertEquals("created", payload.setAction("created").getAction());
+ assertEquals(pullRequest, payload.setPullRequest(pullRequest).getPullRequest());
assertEquals(comment, payload.setComment(comment).getComment());
}
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java
index 04f6d8a0..2a52b37d 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java
@@ -13,6 +13,7 @@ package org.eclipse.egit.github.core.event;
import java.io.Serializable;
import org.eclipse.egit.github.core.CommitComment;
+import org.eclipse.egit.github.core.PullRequest;
/**
* Payload for an event with type {@link Event#TYPE_PULL_REQUEST_REVIEW_COMMENT}
@@ -22,8 +23,30 @@ public class PullRequestReviewCommentPayload extends EventPayload implements
private static final long serialVersionUID = -2403658752886394741L;
+ private String action;
+
private CommitComment comment;
+ private PullRequest pullRequest;
+
+ /**
+ * @return action
+ * @since 4.1
+ */
+ public String getAction() {
+ return action;
+ }
+
+ /**
+ * @param action
+ * @return this PullRequestReviewCommentPayload
+ * @since 4.1
+ */
+ public PullRequestReviewCommentPayload setAction(String action) {
+ this.action = action;
+ return this;
+ }
+
/**
* @return comment
*/
@@ -39,4 +62,22 @@ public class PullRequestReviewCommentPayload extends EventPayload implements
this.comment = comment;
return this;
}
+
+ /**
+ * @return pullRequest
+ * @since 4.1
+ */
+ public PullRequest getPullRequest() {
+ return pullRequest;
+ }
+
+ /**
+ * @param pullRequest
+ * @return this PullRequestReviewCommentPayload
+ * @since 4.1
+ */
+ public PullRequestReviewCommentPayload setPullRequest(PullRequest pullRequest) {
+ this.pullRequest = pullRequest;
+ return this;
+ }
}

Back to the top