{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments/38104854","id":38104854,"diff_hunk":"@@ -0,0 +1,78 @@\n+package com.wikia.webdriver.common.core.api;\n+\n+import com.wikia.webdriver.common.core.Helios;\n+import com.wikia.webdriver.common.core.annotations.User;\n+import com.wikia.webdriver.common.logging.PageObjectLogging;\n+\n+import org.apache.http.NameValuePair;\n+import org.apache.http.client.ClientProtocolException;\n+import org.apache.http.client.entity.UrlEncodedFormEntity;\n+import org.apache.http.client.methods.HttpPost;\n+import org.apache.http.impl.client.CloseableHttpClient;\n+import org.apache.http.impl.client.HttpClients;\n+import org.openqa.selenium.WebDriverException;\n+\n+import java.io.IOException;\n+import java.net.MalformedURLException;\n+import java.net.URI;\n+import java.net.URISyntaxException;\n+import java.net.URL;\n+import java.nio.charset.StandardCharsets;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+/**\n+ * Created by wikia on 2015-08-27.\n+ */\n+public abstract class ApiCall {\n+\n+  private static String ERROR_MESSAGE = \"Problem with API call\";\n+\n+  protected static String URL_STRING = null;\n+  protected static User user = null;\n+  protected static List<NameValuePair> nvps = null;\n+\n+  public ApiCall() {\n+    user = null;\n+    nvps = new ArrayList<>();\n+  }\n+\n+  public static void call() {\n+    try {\n+      CloseableHttpClient httpClient = HttpClients.createDefault();\n+      HttpPost httpPost = getHtppPost();\n+      //set header\n+      if (user != null) {\n+        httpPost.addHeader(\"Authorization\", \"Bearer \" + Helios.getAccessToken(user));\n+      }\n+      //set query params\n+      if (nvps != null) {\n+        httpPost.setEntity(new UrlEncodedFormEntity(nvps, StandardCharsets.UTF_8));\n+      }\n+\n+      httpClient.execute(httpPost);\n+\n+      PageObjectLogging\n+          .log(\"CONTENT PUSH\", \"Content posted to: \" + URL_STRING,\n+               true);\n+    } catch (ClientProtocolException e) {","path":"src/test/java/com/wikia/webdriver/common/core/api/ApiCall.java","position":58,"original_position":58,"commit_id":"577f891cda22bf49906adb3fbbfc183e2f494ef9","original_commit_id":"577f891cda22bf49906adb3fbbfc183e2f494ef9","user":{"login":"WikiaTech","id":13279985,"avatar_url":"https://avatars.githubusercontent.com/u/13279985?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiaTech","html_url":"https://github.com/WikiaTech","followers_url":"https://api.github.com/users/WikiaTech/followers","following_url":"https://api.github.com/users/WikiaTech/following{/other_user}","gists_url":"https://api.github.com/users/WikiaTech/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiaTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiaTech/subscriptions","organizations_url":"https://api.github.com/users/WikiaTech/orgs","repos_url":"https://api.github.com/users/WikiaTech/repos","events_url":"https://api.github.com/users/WikiaTech/events{/privacy}","received_events_url":"https://api.github.com/users/WikiaTech/received_events","type":"User","site_admin":false},"body":"![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) Either log or rethrow this exception. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AS1166)\n","created_at":"2015-08-27T14:57:00Z","updated_at":"2015-08-27T14:57:00Z","html_url":"https://github.com/Wikia/selenium-tests/pull/830#discussion_r38104854","pull_request_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830","_links":{"self":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments/38104854"},"html":{"href":"https://github.com/Wikia/selenium-tests/pull/830#discussion_r38104854"},"pull_request":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830","id":43400715,"html_url":"https://github.com/Wikia/selenium-tests/pull/830","diff_url":"https://github.com/Wikia/selenium-tests/pull/830.diff","patch_url":"https://github.com/Wikia/selenium-tests/pull/830.patch","issue_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/830","number":830,"state":"open","locked":false,"title":"adding clear Curated Content method","user":{"login":"justnpT","id":1735454,"avatar_url":"https://avatars.githubusercontent.com/u/1735454?v=3","gravatar_id":"","url":"https://api.github.com/users/justnpT","html_url":"https://github.com/justnpT","followers_url":"https://api.github.com/users/justnpT/followers","following_url":"https://api.github.com/users/justnpT/following{/other_user}","gists_url":"https://api.github.com/users/justnpT/gists{/gist_id}","starred_url":"https://api.github.com/users/justnpT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justnpT/subscriptions","organizations_url":"https://api.github.com/users/justnpT/orgs","repos_url":"https://api.github.com/users/justnpT/repos","events_url":"https://api.github.com/users/justnpT/events{/privacy}","received_events_url":"https://api.github.com/users/justnpT/received_events","type":"User","site_admin":false},"body":"Implementation of the method that allows clearing Curated Content data through API","created_at":"2015-08-26T13:21:17Z","updated_at":"2015-08-27T14:57:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5c736600e3f4c6fdae4600d4cecd3a574f6d6cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830/commits","review_comments_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830/comments","review_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/830/comments","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/577f891cda22bf49906adb3fbbfc183e2f494ef9","head":{"label":"Wikia:XW-85","ref":"XW-85","sha":"577f891cda22bf49906adb3fbbfc183e2f494ef9","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":6275065,"name":"selenium-tests","full_name":"Wikia/selenium-tests","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/selenium-tests","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/selenium-tests","forks_url":"https://api.github.com/repos/Wikia/selenium-tests/forks","keys_url":"https://api.github.com/repos/Wikia/selenium-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/selenium-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/selenium-tests/teams","hooks_url":"https://api.github.com/repos/Wikia/selenium-tests/hooks","issue_events_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/selenium-tests/events","assignees_url":"https://api.github.com/repos/Wikia/selenium-tests/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/selenium-tests/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/selenium-tests/tags","blobs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/selenium-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/selenium-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/selenium-tests/languages","stargazers_url":"https://api.github.com/repos/Wikia/selenium-tests/stargazers","contributors_url":"https://api.github.com/repos/Wikia/selenium-tests/contributors","subscribers_url":"https://api.github.com/repos/Wikia/selenium-tests/subscribers","subscription_url":"https://api.github.com/repos/Wikia/selenium-tests/subscription","commits_url":"https://api.github.com/repos/Wikia/selenium-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/selenium-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/selenium-tests/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/selenium-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/selenium-tests/merges","archive_url":"https://api.github.com/repos/Wikia/selenium-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/selenium-tests/downloads","issues_url":"https://api.github.com/repos/Wikia/selenium-tests/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/selenium-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/selenium-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/selenium-tests/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/selenium-tests/releases{/id}","created_at":"2012-10-18T08:06:11Z","updated_at":"2015-08-24T15:10:13Z","pushed_at":"2015-08-27T14:56:37Z","git_url":"git://github.com/Wikia/selenium-tests.git","ssh_url":"git@github.com:Wikia/selenium-tests.git","clone_url":"https://github.com/Wikia/selenium-tests.git","svn_url":"https://github.com/Wikia/selenium-tests","homepage":null,"size":216176,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":9,"forks":10,"open_issues":9,"watchers":8,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"dad8e22b47de95e6f1bf9f2048eac88a93453143","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":6275065,"name":"selenium-tests","full_name":"Wikia/selenium-tests","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/selenium-tests","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/selenium-tests","forks_url":"https://api.github.com/repos/Wikia/selenium-tests/forks","keys_url":"https://api.github.com/repos/Wikia/selenium-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/selenium-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/selenium-tests/teams","hooks_url":"https://api.github.com/repos/Wikia/selenium-tests/hooks","issue_events_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/selenium-tests/events","assignees_url":"https://api.github.com/repos/Wikia/selenium-tests/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/selenium-tests/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/selenium-tests/tags","blobs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/selenium-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/selenium-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/selenium-tests/languages","stargazers_url":"https://api.github.com/repos/Wikia/selenium-tests/stargazers","contributors_url":"https://api.github.com/repos/Wikia/selenium-tests/contributors","subscribers_url":"https://api.github.com/repos/Wikia/selenium-tests/subscribers","subscription_url":"https://api.github.com/repos/Wikia/selenium-tests/subscription","commits_url":"https://api.github.com/repos/Wikia/selenium-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/selenium-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/selenium-tests/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/selenium-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/selenium-tests/merges","archive_url":"https://api.github.com/repos/Wikia/selenium-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/selenium-tests/downloads","issues_url":"https://api.github.com/repos/Wikia/selenium-tests/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/selenium-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/selenium-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/selenium-tests/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/selenium-tests/releases{/id}","created_at":"2012-10-18T08:06:11Z","updated_at":"2015-08-24T15:10:13Z","pushed_at":"2015-08-27T14:56:37Z","git_url":"git://github.com/Wikia/selenium-tests.git","ssh_url":"git@github.com:Wikia/selenium-tests.git","clone_url":"https://github.com/Wikia/selenium-tests.git","svn_url":"https://github.com/Wikia/selenium-tests","homepage":null,"size":216176,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":9,"forks":10,"open_issues":9,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830"},"html":{"href":"https://github.com/Wikia/selenium-tests/pull/830"},"issue":{"href":"https://api.github.com/repos/Wikia/selenium-tests/issues/830"},"comments":{"href":"https://api.github.com/repos/Wikia/selenium-tests/issues/830/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/830/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/selenium-tests/statuses/577f891cda22bf49906adb3fbbfc183e2f494ef9"}}}}