{"action":"created","comment":{"url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/comments/28194025","id":28194025,"diff_hunk":"@@ -0,0 +1,130 @@\n+/**\n+ * Copyright (c) 2013-2014, jcabi.com\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met: 1) Redistributions of source code must retain the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer. 2) Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer in the documentation and/or other materials provided\n+ * with the distribution. 3) Neither the name of the jcabi.com nor\n+ * the names of its contributors may be used to endorse or promote\n+ * products derived from this software without specific prior written\n+ * permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT\n+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n+ * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n+ * OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+package com.jcabi.github;\n+\n+import com.jcabi.github.mock.MkGithub;\n+import com.jcabi.http.Request;\n+import com.jcabi.http.mock.MkAnswer;\n+import com.jcabi.http.mock.MkContainer;\n+import com.jcabi.http.mock.MkGrizzlyContainer;\n+import com.jcabi.http.request.ApacheRequest;\n+import org.hamcrest.MatcherAssert;\n+import org.hamcrest.Matchers;\n+import org.junit.Test;\n+\n+import javax.json.Json;\n+import java.net.HttpURLConnection;\n+\n+/**\n+ * Testcase for RtCommits.\n+ *\n+ * @author Marcin Cylke\n+ * @version $Id$\n+ * @checkstyle MultipleStringLiterals (500 lines)\n+ */\n+public class RtStatusesTest {\n+\n+    /**\n+     * Tests creating a Commit.\n+     *\n+     * @throws Exception when an error occurs\n+     */\n+    @Test\n+    public final void createsStatus() throws Exception {\n+        final String sha = \"0abcd89jcabitest\";\n+        final MkContainer container = new MkGrizzlyContainer().next(\n+            new MkAnswer.Simple(\n+                HttpURLConnection.HTTP_CREATED,\n+                \"{\\n\" +\n+                        \"  \\\"created_at\\\": \\\"2012-07-20T01:19:13Z\\\",\\n\" +\n+                        \"  \\\"updated_at\\\": \\\"2012-07-20T01:19:13Z\\\",\\n\" +\n+                        \"  \\\"state\\\": \\\"failure\\\",\\n\" +\n+                        \"  \\\"target_url\\\": \\\"https://ci.example.com/1000/output\\\",\\n\" +\n+                        \"  \\\"description\\\": \\\"Build has completed successfully\\\",\\n\" +\n+                        \"  \\\"id\\\": 1,\\n\" +\n+                        \"  \\\"url\\\": \\\"https://api.github.com/repos/octocat/Hello-World/statuses/1\\\",\\n\" +\n+                        \"  \\\"context\\\": \\\"continuous-integration/jenkins\\\",\\n\" +\n+                        \"  \\\"creator\\\": {\\n\" +\n+                        \"    \\\"login\\\": \\\"octocat\\\",\\n\" +\n+                        \"    \\\"id\\\": 1,\\n\" +\n+                        \"    \\\"avatar_url\\\": \\\"https://github.com/images/error/octocat_happy.gif\\\",\\n\" +\n+                        \"    \\\"gravatar_id\\\": \\\"\\\",\\n\" +\n+                        \"    \\\"url\\\": \\\"https://api.github.com/users/octocat\\\",\\n\" +\n+                        \"    \\\"html_url\\\": \\\"https://github.com/octocat\\\",\\n\" +\n+                        \"    \\\"followers_url\\\": \\\"https://api.github.com/users/octocat/followers\\\",\\n\" +\n+                        \"    \\\"following_url\\\": \\\"https://api.github.com/users/octocat/following{/other_user}\\\",\\n\" +\n+                        \"    \\\"gists_url\\\": \\\"https://api.github.com/users/octocat/gists{/gist_id}\\\",\\n\" +\n+                        \"    \\\"starred_url\\\": \\\"https://api.github.com/users/octocat/starred{/owner}{/repo}\\\",\\n\" +\n+                        \"    \\\"subscriptions_url\\\": \\\"https://api.github.com/users/octocat/subscriptions\\\",\\n\" +\n+                        \"    \\\"organizations_url\\\": \\\"https://api.github.com/users/octocat/orgs\\\",\\n\" +\n+                        \"    \\\"repos_url\\\": \\\"https://api.github.com/users/octocat/repos\\\",\\n\" +\n+                        \"    \\\"events_url\\\": \\\"https://api.github.com/users/octocat/events{/privacy}\\\",\\n\" +\n+                        \"    \\\"received_events_url\\\": \\\"https://api.github.com/users/octocat/received_events\\\",\\n\" +\n+                        \"    \\\"type\\\": \\\"User\\\",\\n\" +\n+                        \"    \\\"site_admin\\\": false\\n\" +\n+                        \"  }\\n\" +\n+                        \"}\"\n+            )\n+        ).start();\n+        final Request req = new ApacheRequest(container.home());\n+        final Statuses statuses = new RtStatuses(req, new RtCommit(req, repo(), sha));\n+\n+        try {\n+            final Status newStatus = statuses.create(","path":"src/test/java/com/jcabi/github/RtStatusesTest.java","position":100,"original_position":100,"commit_id":"eb71ab91e0034b017ea7c3d6bab509cd9559ef40","original_commit_id":"eb71ab91e0034b017ea7c3d6bab509cd9559ef40","user":{"login":"longtimeago","id":1388994,"avatar_url":"https://avatars.githubusercontent.com/u/1388994?v=3","gravatar_id":"","url":"https://api.github.com/users/longtimeago","html_url":"https://github.com/longtimeago","followers_url":"https://api.github.com/users/longtimeago/followers","following_url":"https://api.github.com/users/longtimeago/following{/other_user}","gists_url":"https://api.github.com/users/longtimeago/gists{/gist_id}","starred_url":"https://api.github.com/users/longtimeago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longtimeago/subscriptions","organizations_url":"https://api.github.com/users/longtimeago/orgs","repos_url":"https://api.github.com/users/longtimeago/repos","events_url":"https://api.github.com/users/longtimeago/events{/privacy}","received_events_url":"https://api.github.com/users/longtimeago/received_events","type":"User","site_admin":false},"body":"@zygm0nt name ```status``` would be good enough","created_at":"2015-04-11T10:33:37Z","updated_at":"2015-04-11T10:33:37Z","html_url":"https://github.com/jcabi/jcabi-github/pull/1047#discussion_r28194025","pull_request_url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047","_links":{"self":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/comments/28194025"},"html":{"href":"https://github.com/jcabi/jcabi-github/pull/1047#discussion_r28194025"},"pull_request":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047"}}},"pull_request":{"url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047","id":32998344,"html_url":"https://github.com/jcabi/jcabi-github/pull/1047","diff_url":"https://github.com/jcabi/jcabi-github/pull/1047.diff","patch_url":"https://github.com/jcabi/jcabi-github/pull/1047.patch","issue_url":"https://api.github.com/repos/jcabi/jcabi-github/issues/1047","number":1047,"state":"open","locked":false,"title":"Github Status API","user":{"login":"zygm0nt","id":179461,"avatar_url":"https://avatars.githubusercontent.com/u/179461?v=3","gravatar_id":"","url":"https://api.github.com/users/zygm0nt","html_url":"https://github.com/zygm0nt","followers_url":"https://api.github.com/users/zygm0nt/followers","following_url":"https://api.github.com/users/zygm0nt/following{/other_user}","gists_url":"https://api.github.com/users/zygm0nt/gists{/gist_id}","starred_url":"https://api.github.com/users/zygm0nt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zygm0nt/subscriptions","organizations_url":"https://api.github.com/users/zygm0nt/orgs","repos_url":"https://api.github.com/users/zygm0nt/repos","events_url":"https://api.github.com/users/zygm0nt/events{/privacy}","received_events_url":"https://api.github.com/users/zygm0nt/received_events","type":"User","site_admin":false},"body":"The things I'm currently missing from this library is Status API support. So I've implemented it. Please have a look. The implementation is rough at the edges, but works in a basic case of adding a new status for a commit.\r\n\r\nRelated links:\r\nhttps://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref\r\nhttps://github.com/blog/1935-see-results-from-all-pull-request-status-checks\r\n\r\nPlease let me know if this is something you are interested in it. Do you require exact implementation of the API - like handling whole return messages from StatusAPI, or skeleton response is fine for now?","created_at":"2015-04-09T21:30:34Z","updated_at":"2015-04-11T10:33:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f44534b049b266fe0884d97a9b353b6feb6fa49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047/commits","review_comments_url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047/comments","review_comment_url":"https://api.github.com/repos/jcabi/jcabi-github/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jcabi/jcabi-github/issues/1047/comments","statuses_url":"https://api.github.com/repos/jcabi/jcabi-github/statuses/eb71ab91e0034b017ea7c3d6bab509cd9559ef40","head":{"label":"zygm0nt:github-status-api","ref":"github-status-api","sha":"eb71ab91e0034b017ea7c3d6bab509cd9559ef40","user":{"login":"zygm0nt","id":179461,"avatar_url":"https://avatars.githubusercontent.com/u/179461?v=3","gravatar_id":"","url":"https://api.github.com/users/zygm0nt","html_url":"https://github.com/zygm0nt","followers_url":"https://api.github.com/users/zygm0nt/followers","following_url":"https://api.github.com/users/zygm0nt/following{/other_user}","gists_url":"https://api.github.com/users/zygm0nt/gists{/gist_id}","starred_url":"https://api.github.com/users/zygm0nt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zygm0nt/subscriptions","organizations_url":"https://api.github.com/users/zygm0nt/orgs","repos_url":"https://api.github.com/users/zygm0nt/repos","events_url":"https://api.github.com/users/zygm0nt/events{/privacy}","received_events_url":"https://api.github.com/users/zygm0nt/received_events","type":"User","site_admin":false},"repo":{"id":27841182,"name":"jcabi-github","full_name":"zygm0nt/jcabi-github","owner":{"login":"zygm0nt","id":179461,"avatar_url":"https://avatars.githubusercontent.com/u/179461?v=3","gravatar_id":"","url":"https://api.github.com/users/zygm0nt","html_url":"https://github.com/zygm0nt","followers_url":"https://api.github.com/users/zygm0nt/followers","following_url":"https://api.github.com/users/zygm0nt/following{/other_user}","gists_url":"https://api.github.com/users/zygm0nt/gists{/gist_id}","starred_url":"https://api.github.com/users/zygm0nt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zygm0nt/subscriptions","organizations_url":"https://api.github.com/users/zygm0nt/orgs","repos_url":"https://api.github.com/users/zygm0nt/repos","events_url":"https://api.github.com/users/zygm0nt/events{/privacy}","received_events_url":"https://api.github.com/users/zygm0nt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zygm0nt/jcabi-github","description":"Object Oriented Wrapper of Github API","fork":true,"url":"https://api.github.com/repos/zygm0nt/jcabi-github","forks_url":"https://api.github.com/repos/zygm0nt/jcabi-github/forks","keys_url":"https://api.github.com/repos/zygm0nt/jcabi-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zygm0nt/jcabi-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zygm0nt/jcabi-github/teams","hooks_url":"https://api.github.com/repos/zygm0nt/jcabi-github/hooks","issue_events_url":"https://api.github.com/repos/zygm0nt/jcabi-github/issues/events{/number}","events_url":"https://api.github.com/repos/zygm0nt/jcabi-github/events","assignees_url":"https://api.github.com/repos/zygm0nt/jcabi-github/assignees{/user}","branches_url":"https://api.github.com/repos/zygm0nt/jcabi-github/branches{/branch}","tags_url":"https://api.github.com/repos/zygm0nt/jcabi-github/tags","blobs_url":"https://api.github.com/repos/zygm0nt/jcabi-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zygm0nt/jcabi-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zygm0nt/jcabi-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/zygm0nt/jcabi-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zygm0nt/jcabi-github/statuses/{sha}","languages_url":"https://api.github.com/repos/zygm0nt/jcabi-github/languages","stargazers_url":"https://api.github.com/repos/zygm0nt/jcabi-github/stargazers","contributors_url":"https://api.github.com/repos/zygm0nt/jcabi-github/contributors","subscribers_url":"https://api.github.com/repos/zygm0nt/jcabi-github/subscribers","subscription_url":"https://api.github.com/repos/zygm0nt/jcabi-github/subscription","commits_url":"https://api.github.com/repos/zygm0nt/jcabi-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/zygm0nt/jcabi-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/zygm0nt/jcabi-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/zygm0nt/jcabi-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/zygm0nt/jcabi-github/contents/{+path}","compare_url":"https://api.github.com/repos/zygm0nt/jcabi-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zygm0nt/jcabi-github/merges","archive_url":"https://api.github.com/repos/zygm0nt/jcabi-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zygm0nt/jcabi-github/downloads","issues_url":"https://api.github.com/repos/zygm0nt/jcabi-github/issues{/number}","pulls_url":"https://api.github.com/repos/zygm0nt/jcabi-github/pulls{/number}","milestones_url":"https://api.github.com/repos/zygm0nt/jcabi-github/milestones{/number}","notifications_url":"https://api.github.com/repos/zygm0nt/jcabi-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zygm0nt/jcabi-github/labels{/name}","releases_url":"https://api.github.com/repos/zygm0nt/jcabi-github/releases{/id}","created_at":"2014-12-10T21:43:18Z","updated_at":"2014-12-10T21:43:20Z","pushed_at":"2015-04-09T21:27:33Z","git_url":"git://github.com/zygm0nt/jcabi-github.git","ssh_url":"git@github.com:zygm0nt/jcabi-github.git","clone_url":"https://github.com/zygm0nt/jcabi-github.git","svn_url":"https://github.com/zygm0nt/jcabi-github","homepage":"github.jcabi.com","size":20508,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jcabi:master","ref":"master","sha":"f82d86b0fa6449c1872125e44a7953f9ec6536b4","user":{"login":"jcabi","id":5272640,"avatar_url":"https://avatars.githubusercontent.com/u/5272640?v=3","gravatar_id":"","url":"https://api.github.com/users/jcabi","html_url":"https://github.com/jcabi","followers_url":"https://api.github.com/users/jcabi/followers","following_url":"https://api.github.com/users/jcabi/following{/other_user}","gists_url":"https://api.github.com/users/jcabi/gists{/gist_id}","starred_url":"https://api.github.com/users/jcabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcabi/subscriptions","organizations_url":"https://api.github.com/users/jcabi/orgs","repos_url":"https://api.github.com/users/jcabi/repos","events_url":"https://api.github.com/users/jcabi/events{/privacy}","received_events_url":"https://api.github.com/users/jcabi/received_events","type":"Organization","site_admin":false},"repo":{"id":14204295,"name":"jcabi-github","full_name":"jcabi/jcabi-github","owner":{"login":"jcabi","id":5272640,"avatar_url":"https://avatars.githubusercontent.com/u/5272640?v=3","gravatar_id":"","url":"https://api.github.com/users/jcabi","html_url":"https://github.com/jcabi","followers_url":"https://api.github.com/users/jcabi/followers","following_url":"https://api.github.com/users/jcabi/following{/other_user}","gists_url":"https://api.github.com/users/jcabi/gists{/gist_id}","starred_url":"https://api.github.com/users/jcabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcabi/subscriptions","organizations_url":"https://api.github.com/users/jcabi/orgs","repos_url":"https://api.github.com/users/jcabi/repos","events_url":"https://api.github.com/users/jcabi/events{/privacy}","received_events_url":"https://api.github.com/users/jcabi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jcabi/jcabi-github","description":"Object Oriented Wrapper of Github API","fork":false,"url":"https://api.github.com/repos/jcabi/jcabi-github","forks_url":"https://api.github.com/repos/jcabi/jcabi-github/forks","keys_url":"https://api.github.com/repos/jcabi/jcabi-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcabi/jcabi-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcabi/jcabi-github/teams","hooks_url":"https://api.github.com/repos/jcabi/jcabi-github/hooks","issue_events_url":"https://api.github.com/repos/jcabi/jcabi-github/issues/events{/number}","events_url":"https://api.github.com/repos/jcabi/jcabi-github/events","assignees_url":"https://api.github.com/repos/jcabi/jcabi-github/assignees{/user}","branches_url":"https://api.github.com/repos/jcabi/jcabi-github/branches{/branch}","tags_url":"https://api.github.com/repos/jcabi/jcabi-github/tags","blobs_url":"https://api.github.com/repos/jcabi/jcabi-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcabi/jcabi-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcabi/jcabi-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcabi/jcabi-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcabi/jcabi-github/statuses/{sha}","languages_url":"https://api.github.com/repos/jcabi/jcabi-github/languages","stargazers_url":"https://api.github.com/repos/jcabi/jcabi-github/stargazers","contributors_url":"https://api.github.com/repos/jcabi/jcabi-github/contributors","subscribers_url":"https://api.github.com/repos/jcabi/jcabi-github/subscribers","subscription_url":"https://api.github.com/repos/jcabi/jcabi-github/subscription","commits_url":"https://api.github.com/repos/jcabi/jcabi-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcabi/jcabi-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcabi/jcabi-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcabi/jcabi-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcabi/jcabi-github/contents/{+path}","compare_url":"https://api.github.com/repos/jcabi/jcabi-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcabi/jcabi-github/merges","archive_url":"https://api.github.com/repos/jcabi/jcabi-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcabi/jcabi-github/downloads","issues_url":"https://api.github.com/repos/jcabi/jcabi-github/issues{/number}","pulls_url":"https://api.github.com/repos/jcabi/jcabi-github/pulls{/number}","milestones_url":"https://api.github.com/repos/jcabi/jcabi-github/milestones{/number}","notifications_url":"https://api.github.com/repos/jcabi/jcabi-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcabi/jcabi-github/labels{/name}","releases_url":"https://api.github.com/repos/jcabi/jcabi-github/releases{/id}","created_at":"2013-11-07T13:23:16Z","updated_at":"2015-04-06T15:02:23Z","pushed_at":"2015-04-09T21:30:35Z","git_url":"git://github.com/jcabi/jcabi-github.git","ssh_url":"git@github.com:jcabi/jcabi-github.git","clone_url":"https://github.com/jcabi/jcabi-github.git","svn_url":"https://github.com/jcabi/jcabi-github","homepage":"github.jcabi.com","size":38505,"stargazers_count":60,"watchers_count":60,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":59,"mirror_url":null,"open_issues_count":26,"forks":59,"open_issues":26,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047"},"html":{"href":"https://github.com/jcabi/jcabi-github/pull/1047"},"issue":{"href":"https://api.github.com/repos/jcabi/jcabi-github/issues/1047"},"comments":{"href":"https://api.github.com/repos/jcabi/jcabi-github/issues/1047/comments"},"review_comments":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047/comments"},"review_comment":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jcabi/jcabi-github/pulls/1047/commits"},"statuses":{"href":"https://api.github.com/repos/jcabi/jcabi-github/statuses/eb71ab91e0034b017ea7c3d6bab509cd9559ef40"}}}}