Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Ander Peñalba2015-03-05 09:51:14 +0000
committerJon Ander Peñalba2015-03-10 23:39:35 +0000
commit25724ff0dfa9ff7adec2c4b428c9e2809b881f6d (patch)
tree4df7653db046e8c232cfb1d2570f0b7fbeff3f78 /org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github
parent76dc8a6ef060de819a3e3c99d535fdca2a8785d9 (diff)
downloadegit-github-25724ff0dfa9ff7adec2c4b428c9e2809b881f6d.tar.gz
egit-github-25724ff0dfa9ff7adec2c4b428c9e2809b881f6d.tar.xz
egit-github-25724ff0dfa9ff7adec2c4b428c9e2809b881f6d.zip
Improve the IssueEvent class adding more fields
Relevant GitHub API docs: https://developer.github.com/v3/issues/events/ Change-Id: I5f4e64558ca3eb010bdd01680c0056676c0f7738 Signed-off-by: Jon Ander Peñalba <jonan88@gmail.com>
Diffstat (limited to 'org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github')
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
index 67f372b2..4068b07e 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
@@ -19,6 +19,7 @@ import java.util.Date;
import org.eclipse.egit.github.core.Issue;
import org.eclipse.egit.github.core.IssueEvent;
import org.eclipse.egit.github.core.Label;
+import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.User;
import org.junit.Test;
@@ -33,13 +34,15 @@ public class IssueEventTest {
@Test
public void defaultState() {
IssueEvent event = new IssueEvent();
+ assertEquals(0, event.getId());
+ assertNull(event.getUrl());
assertNull(event.getActor());
assertNull(event.getCommitId());
- assertNull(event.getCreatedAt());
assertNull(event.getEvent());
- assertEquals(0, event.getId());
+ assertNull(event.getCreatedAt());
assertNull(event.getLabel());
- assertNull(event.getUrl());
+ assertNull(event.getAssignee());
+ assertNull(event.getMilestone());
assertNull(event.getIssue());
}
@@ -49,16 +52,20 @@ public class IssueEventTest {
@Test
public void updateFields() {
IssueEvent event = new IssueEvent();
+ assertEquals(4356, event.setId(4356).getId());
+ assertEquals("url://a", event.setUrl("url://a").getUrl());
User actor = new User().setName("Act Tor");
assertEquals(actor, event.setActor(actor).getActor());
assertEquals("a12b", event.setCommitId("a12b").getCommitId());
+ assertEquals(IssueEvent.TYPE_CLOSED, event.setEvent("closed").getEvent());
assertEquals(new Date(60000), event.setCreatedAt(new Date(60000))
.getCreatedAt());
- assertEquals(4356, event.setId(4356).getId());
Label label = new Label().setName("Lab El").setColor("563d7c");
assertEquals(label, event.setLabel(label).getLabel());
- assertEquals("commit", event.setEvent("commit").getEvent());
- assertEquals("url://a", event.setUrl("url://a").getUrl());
+ User assignee = new User().setName("Assig Nee");
+ assertEquals(assignee, event.setAssignee(assignee).getAssignee());
+ Milestone milestone = new Milestone().setTitle("Milestone");
+ assertEquals(milestone, event.setMilestone(milestone).getMilestone());
Issue issue = new Issue().setNumber(30);
assertEquals(issue, event.setIssue(issue).getIssue());
}

Back to the top