Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron S. Hawley2019-06-17 06:33:28 +0000
committerAaron S. Hawley2019-06-17 13:17:30 +0000
commit7a8c24d36f2214f6d7a97bb09249974d978188fe (patch)
tree6023cce26826c8adc103f360442276832b68bd27 /org.eclipse.egit.github.core.tests/src/org/eclipse
parent0f7592f24a097ab53c9628d0d4b37b55d0bf1f1e (diff)
downloadegit-github-7a8c24d36f2214f6d7a97bb09249974d978188fe.tar.gz
egit-github-7a8c24d36f2214f6d7a97bb09249974d978188fe.tar.xz
egit-github-7a8c24d36f2214f6d7a97bb09249974d978188fe.zip
Add new fields for GitHub push event
Fields that were missing: * After * Created, Deleted, Forced * Base ref * Compare * Distinct size * Head commit * Organization, Pusher, Repository, Sender https://developer.github.com/v3/activity/events/types/#pushevent Bug: 521783 Change-Id: Ibdc22e983aa81ddb638c2fd8ad724ea8957be43f Signed-off-by: Aaron S. Hawley <aaron.s.hawley@gmail.com>
Diffstat (limited to 'org.eclipse.egit.github.core.tests/src/org/eclipse')
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
index f4911093..e914b51c 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java
@@ -13,6 +13,8 @@
package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import java.util.ArrayList;
@@ -36,8 +38,20 @@ public class PushPayloadTest {
assertNull(payload.getHead());
assertNull(payload.getRef());
assertEquals(0, payload.getSize());
+ assertEquals(0, payload.getDistinctSize());
assertNull(payload.getCommits());
assertNull(payload.getBefore());
+ assertNull(payload.getAfter());
+ assertFalse(payload.isCreated());
+ assertFalse(payload.isDeleted());
+ assertFalse(payload.isForced());
+ assertNull(payload.getBaseRef());
+ assertNull(payload.getCompare());
+ assertNull(payload.getHeadCommit());
+ assertNull(payload.getRepository());
+ assertNull(payload.getPusher());
+ assertNull(payload.getOrganization());
+ assertNull(payload.getSender());
}
/**
@@ -51,7 +65,14 @@ public class PushPayloadTest {
assertEquals("head", payload.setHead("head").getHead());
assertEquals("ref", payload.setRef("ref").getRef());
assertEquals(9000, payload.setSize(9000).getSize());
+ assertEquals(8000, payload.setDistinctSize(8000).getDistinctSize());
assertEquals(commits, payload.setCommits(commits).getCommits());
assertEquals("a1b2", payload.setBefore("a1b2").getBefore());
+ assertEquals("2b1a", payload.setAfter("2b1a").getAfter());
+ assertTrue(payload.setCreated(true).isCreated());
+ assertTrue(payload.setDeleted(true).isDeleted());
+ assertTrue(payload.setForced(true).isForced());
+ assertEquals("base", payload.setBaseRef("base").getBaseRef());
+ assertEquals("http", payload.setCompare("http").getCompare());
}
}

Back to the top