Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-06-27 22:49:41 +0000
committerKevin Sawicki2012-06-27 22:49:41 +0000
commit4f078ca961f3852049d5049558669f1cd8f6667d (patch)
treee52d8f596368f23ab130164ee07a2f67072010a7
parent5bf04afbf04992bf92a5ac4b1693d7311d2f8fed (diff)
downloadegit-github-4f078ca961f3852049d5049558669f1cd8f6667d.tar.gz
egit-github-4f078ca961f3852049d5049558669f1cd8f6667d.tar.xz
egit-github-4f078ca961f3852049d5049558669f1cd8f6667d.zip
Add milestone and assignee to PullRequest model class
-rwxr-xr-xorg.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PullRequestTest.java8
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/PullRequest.java36
2 files changed, 44 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 9903f779..c03f5ce8 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
@@ -18,6 +18,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Date;
+import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.PullRequest;
import org.eclipse.egit.github.core.PullRequestMarker;
import org.eclipse.egit.github.core.User;
@@ -62,6 +63,8 @@ public class PullRequestTest {
assertNull(request.getUser());
assertNotNull(request.toString());
assertEquals(0, request.getId());
+ assertNull(request.getMilestone());
+ assertNull(request.getAssignee());
}
/**
@@ -107,6 +110,11 @@ public class PullRequestTest {
User user = new User().setLogin("cuser");
assertEquals(user, request.setUser(user).getUser());
assertEquals(70, request.setId(70).getId());
+
+ User assignee = new User().setLogin("assignee");
+ assertEquals(assignee, request.setAssignee(assignee).getAssignee());
+ Milestone milestone = new Milestone().setNumber(456);
+ assertEquals(milestone, request.setMilestone(milestone).getMilestone());
}
/**
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 b262ae74..98f731f7 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
@@ -49,6 +49,8 @@ public class PullRequest implements Serializable {
private int number;
+ private Milestone milestone;
+
private PullRequestMarker base;
private PullRequestMarker head;
@@ -73,6 +75,8 @@ public class PullRequest implements Serializable {
private String url;
+ private User assignee;
+
private User mergedBy;
private User user;
@@ -509,6 +513,38 @@ public class PullRequest implements Serializable {
return this;
}
+ /**
+ * @return milestone
+ */
+ public Milestone getMilestone() {
+ return milestone;
+ }
+
+ /**
+ * @param milestone
+ * @return this pull request
+ */
+ public PullRequest setMilestone(Milestone milestone) {
+ this.milestone = milestone;
+ return this;
+ }
+
+ /**
+ * @return assignee
+ */
+ public User getAssignee() {
+ return assignee;
+ }
+
+ /**
+ * @param assignee
+ * @return this pull request
+ */
+ public PullRequest setAssignee(User assignee) {
+ this.assignee = assignee;
+ return this;
+ }
+
@Override
public String toString() {
return "Pull Request " + number; //$NON-NLS-1$

Back to the top