Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-06-25 17:16:48 +0000
committerKevin Sawicki2012-06-25 17:16:48 +0000
commitd604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1 (patch)
tree050067c32f62c61bb6281e5615002847f619d6f4 /org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github
parentdbf1fb5cb319c71380a235239d4901042f9a6ee0 (diff)
downloadegit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.tar.gz
egit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.tar.xz
egit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.zip
Add service support for editing a label
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/LabelServiceTest.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java
index f16dd699..4d3274a4 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java
@@ -439,4 +439,49 @@ public class LabelServiceTest {
request.setUri("/repos/user/repo/labels/bugs");
verify(gitHubClient).get(request);
}
+
+ /**
+ * Edit label with null label
+ *
+ * @throws IOException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void editLabelNullLabel() throws IOException {
+ labelService.editLabel(RepositoryId.create("a", "b"), null);
+ }
+
+ /**
+ * Edit label with null label
+ *
+ * @throws IOException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void editLabelNullLabelName() throws IOException {
+ labelService.editLabel(RepositoryId.create("a", "b"), new Label());
+ }
+
+ /**
+ * Edit label with null label
+ *
+ * @throws IOException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void editLabelEmptyLabelName() throws IOException {
+ labelService.editLabel(RepositoryId.create("a", "b"),
+ new Label().setName(""));
+ }
+
+ /**
+ * Edit label
+ *
+ * @throws IOException
+ */
+ @Test
+ public void editLabel() throws IOException {
+ Label label = new Label();
+ label.setName("l1");
+ label.setColor("#FF");
+ labelService.editLabel(RepositoryId.create("a", "b"), label);
+ verify(gitHubClient).post("/repos/a/b/labels/l1", label, Label.class);
+ }
}

Back to the top