Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaquel Pau2018-02-21 13:38:39 -0500
committerRaquel Pau2018-02-21 13:59:07 -0500
commit900e69e2e8fd81d851e62f86587c86f255a0b273 (patch)
tree2ab05d309879f5646a7afd67e9d0e5c9858c664b
parent8b24d5046e5f2813d8df5f1b4a13ed8f323aea23 (diff)
downloadegit-github-900e69e2e8fd81d851e62f86587c86f255a0b273.tar.gz
egit-github-900e69e2e8fd81d851e62f86587c86f255a0b273.tar.xz
egit-github-900e69e2e8fd81d851e62f86587c86f255a0b273.zip
Add the assignees list in pull request
A pull request can be assigned to a list of people. The pull request object returned by the pull request payload contains that list. This patch adds the "assignees" field into the pull request object. This is an example: https://gist.github.com/rpau/3a68abf2e0af60e1e8b155e9b6d5e5a1 Change-Id: Ib28d4d8ae0ee71a60fc6381d131f669a6d4d788f Signed-off-by: Raquel Pau <raquel.pau@schibsted.com>
-rwxr-xr-xorg.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java6
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java21
2 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java
index 90a2553f..57450280 100755
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java
@@ -16,7 +16,9 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import java.util.Arrays;
import java.util.Date;
+import java.util.List;
import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.PullRequest;
@@ -66,6 +68,7 @@ public class PullRequestTest {
assertEquals(0, request.getId());
assertNull(request.getMilestone());
assertNull(request.getAssignee());
+ assertNull(request.getAssignees());
}
/**
@@ -117,6 +120,9 @@ public class PullRequestTest {
assertEquals(assignee, request.setAssignee(assignee).getAssignee());
Milestone milestone = new Milestone().setNumber(456);
assertEquals(milestone, request.setMilestone(milestone).getMilestone());
+
+ List<User> assigneeList = Arrays.asList(assignee);
+ assertEquals(assigneeList, request.setAssignees(Arrays.asList(assignee)).getAssignees());
}
/**
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java
index ab4dc714..4ea2ff53 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java
@@ -12,6 +12,7 @@ package org.eclipse.egit.github.core;
import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import org.eclipse.egit.github.core.util.DateUtils;
@@ -83,6 +84,8 @@ public class PullRequest implements Serializable {
private User user;
+ private List<User> assignees;
+
/**
* @return mergeable
*/
@@ -565,6 +568,24 @@ public class PullRequest implements Serializable {
return this;
}
+ /**
+ *
+ * @param assignees
+ * @return this pull request
+ */
+ public PullRequest setAssignees(List<User> assignees) {
+ this.assignees = assignees;
+ return this;
+ }
+
+ /**
+ *
+ * @return assignees
+ */
+ public List<User> getAssignees() {
+ return assignees;
+ }
+
@Override
public String toString() {
return "Pull Request " + number; //$NON-NLS-1$

Back to the top