diff options
author | Kevin Sawicki | 2012-06-25 17:16:48 +0000 |
---|---|---|
committer | Kevin Sawicki | 2012-06-25 17:16:48 +0000 |
commit | d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1 (patch) | |
tree | 050067c32f62c61bb6281e5615002847f619d6f4 /org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github | |
parent | dbf1fb5cb319c71380a235239d4901042f9a6ee0 (diff) | |
download | egit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.tar.gz egit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.tar.xz egit-github-d604f8f603fc53c4c18d8c7a961ff3ae75b2e9b1.zip |
Add service support for editing a label
Change-Id: I816837e62aa02788db53c6afc57b8dc4b839171e
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.java | 45 |
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); + } } |