diff options
author | Kevin Sawicki | 2011-05-10 23:08:42 +0000 |
---|---|---|
committer | Chris Aniszczyk | 2011-05-10 23:10:43 +0000 |
commit | 31e119034516c7674964a6c7c87fedefd57376b8 (patch) | |
tree | e516cb1389b75595739a12de0397071bcdb8bb47 /org.eclipse.mylyn.github.tests | |
parent | 579592646e39afaf1872259a4b81bd1c17730291 (diff) | |
download | egit-github-31e119034516c7674964a6c7c87fedefd57376b8.tar.gz egit-github-31e119034516c7674964a6c7c87fedefd57376b8.tar.xz egit-github-31e119034516c7674964a6c7c87fedefd57376b8.zip |
Support new field error objects and null field requirements
Bug: 345341
Change-Id: Ie4cc6c20a33fbf91fbeab1c92c4196ac8e99fb2e
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.mylyn.github.tests')
3 files changed, 13 insertions, 17 deletions
diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/GistServiceTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/GistServiceTest.java index f7715205..833cecf3 100644 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/GistServiceTest.java +++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/GistServiceTest.java @@ -86,7 +86,7 @@ public class GistServiceTest { Gist gist = new Gist(); gist.setUser(null); gistService.createGist(gist); - verify(gitHubClient).post("/gists.json", gist, Gist.class); + verify(gitHubClient).post("/gists", gist, Gist.class); } @Test @@ -96,8 +96,7 @@ public class GistServiceTest { user.setLogin("test_user"); gist.setUser(user); gistService.createGist(gist); - verify(gitHubClient).post("/users/test_user/gists.json", gist, - Gist.class); + verify(gitHubClient).post("/users/test_user/gists", gist, Gist.class); } @Test(expected = AssertionFailedException.class) @@ -126,7 +125,7 @@ public class GistServiceTest { Gist gist = new Gist(); gist.setId("123"); gistService.updateGist(gist); - verify(gitHubClient).put("/gists/123.json", gist, Gist.class); + verify(gitHubClient).post("/gists/123", gist, Gist.class); } @Test(expected = AssertionFailedException.class) @@ -145,8 +144,7 @@ public class GistServiceTest { Map<String, String> params = new HashMap<String, String>(1, 1); params.put(IssueService.FIELD_BODY, "test_comment"); - verify(gitHubClient).post("/gists/1/comments.json", params, - Comment.class); + verify(gitHubClient).post("/gists/1/comments", params, Comment.class); } @Test(expected = AssertionFailedException.class) diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java index 203183ea..c11f2e71 100644 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java +++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java @@ -122,8 +122,7 @@ public class IssueServiceTest { @Test public void createIssue_NullIssue() throws IOException { issueService.createIssue("test_user", "test_repository", null); - verify(gitHubClient).post( - "/repos/test_user/test_repository/issues.json", + verify(gitHubClient).post("/repos/test_user/test_repository/issues", new HashMap<String, String>(), Issue.class); } @@ -155,9 +154,8 @@ public class IssueServiceTest { params.put(IssueService.FIELD_TITLE, "test_title"); params.put(IssueService.FIELD_BODY, "test_body"); params.put(IssueService.FILTER_STATE, "test_state"); - verify(gitHubClient).put( - "/repos/test_user/test_repository/issues/1.json", params, - Issue.class); + verify(gitHubClient).post("/repos/test_user/test_repository/issues/1", + params, Issue.class); } @Test(expected = AssertionFailedException.class) @@ -183,7 +181,7 @@ public class IssueServiceTest { Map<String, String> params = new HashMap<String, String>(); params.put(IssueService.FIELD_BODY, "test_comment"); verify(gitHubClient).post( - "/repos/test_user/test_repository/issues/1/comments.json", - params, Comment.class); + "/repos/test_user/test_repository/issues/1/comments", params, + Comment.class); } } diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/LabelServiceTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/LabelServiceTest.java index d15fb336..543c8eca 100644 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/LabelServiceTest.java +++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/LabelServiceTest.java @@ -95,7 +95,7 @@ public class LabelServiceTest { TypeToken<List<Label>> labelsToken = new TypeToken<List<Label>>() { }; verify(gitHubClient).put( - "/repos/test_user/test_repository/issues/1/labels.json", null, + "/repos/test_user/test_repository/issues/1/labels", null, labelsToken.getType()); } @@ -106,8 +106,8 @@ public class LabelServiceTest { TypeToken<List<Label>> labelsToken = new TypeToken<List<Label>>() { }; verify(gitHubClient).put( - "/repos/test_user/test_repository/issues/1/labels.json", - labels, labelsToken.getType()); + "/repos/test_user/test_repository/issues/1/labels", labels, + labelsToken.getType()); } @Test(expected = AssertionFailedException.class) @@ -130,7 +130,7 @@ public class LabelServiceTest { Label label = new Label(); labelService.createLabel("test_user", "test_repository", label); verify(gitHubClient).post( - "/repos/test_user/test_repository/labels.json", label, + "/repos/test_user/test_repository/labels", label, Label.class); } } |