{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/product-apim/pulls/comments/48091183","id":48091183,"diff_hunk":"@@ -0,0 +1,377 @@\n+/*\n+*Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+*\n+*WSO2 Inc. licenses this file to you under the Apache License,\n+*Version 2.0 (the \"License\"); you may not use this file except\n+*in compliance with the License.\n+*You may obtain a copy of the License at\n+*\n+*http://www.apache.org/licenses/LICENSE-2.0\n+*\n+*Unless required by applicable law or agreed to in writing,\n+*software distributed under the License is distributed on an\n+*\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+*KIND, either express or implied.  See the License for the\n+*specific language governing permissions and limitations\n+*under the License.\n+*/\n+\n+package org.wso2.am.integration.tests.restapi.utils;\n+\n+import org.apache.commons.codec.binary.Base64;\n+import org.apache.commons.logging.Log;\n+import org.apache.commons.logging.LogFactory;\n+import org.apache.commons.lang.RandomStringUtils;\n+import org.apache.cxf.jaxrs.impl.ResponseImpl;\n+import org.json.JSONArray;\n+import org.json.JSONException;\n+import org.json.JSONObject;\n+\n+import org.wso2.am.integration.test.utils.APIManagerIntegrationTestException;\n+import org.wso2.am.integration.tests.restapi.RESTAPITestConstants;\n+import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;\n+import org.wso2.carbon.automation.test.utils.http.client.HttpRequestUtil;\n+import org.wso2.carbon.automation.test.utils.http.client.HttpResponse;\n+\n+import java.io.BufferedReader;\n+import java.io.FileReader;\n+import java.io.IOException;\n+import java.io.File;\n+import java.io.UnsupportedEncodingException;\n+import java.net.MalformedURLException;\n+import java.net.URL;\n+import java.util.HashMap;\n+import java.util.Iterator;\n+import java.util.Map;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+import javax.ws.rs.core.Response;\n+\n+/**\n+ * This class is used as a util class to test the REST API.\n+ */\n+public class RESTAPITestUtil {\n+\n+    private static final Log log = LogFactory.getLog(RESTAPITestUtil.class);\n+    private DataDrivenTestUtils dataDrivenTestUtils = new DataDrivenTestUtils();\n+\n+    /**\n+     * This method is used to test a given scenario using the REST API\n+     *\n+     * @param configFilePath location of the data file\n+     * @param gatewayURL     gateway URL\n+     * @param keyMangerURL   key manager URL\n+     * @return true if all the scenarios in the current test is successful, otherwise false\n+     */\n+    public boolean testRestAPI(String configFilePath, String gatewayURL, String keyMangerURL) {\n+\n+        //this is the boolean which indicates the success or failure of the current test","path":"modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/utils/RESTAPITestUtil.java","position":69,"original_position":69,"commit_id":"c4a8d0c1359f49bbdbab4073e40cf565b4b6dcd3","original_commit_id":"c4a8d0c1359f49bbdbab4073e40cf565b4b6dcd3","user":{"login":"chamindias","id":8359365,"avatar_url":"https://avatars.githubusercontent.com/u/8359365?v=3","gravatar_id":"","url":"https://api.github.com/users/chamindias","html_url":"https://github.com/chamindias","followers_url":"https://api.github.com/users/chamindias/followers","following_url":"https://api.github.com/users/chamindias/following{/other_user}","gists_url":"https://api.github.com/users/chamindias/gists{/gist_id}","starred_url":"https://api.github.com/users/chamindias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamindias/subscriptions","organizations_url":"https://api.github.com/users/chamindias/orgs","repos_url":"https://api.github.com/users/chamindias/repos","events_url":"https://api.github.com/users/chamindias/events{/privacy}","received_events_url":"https://api.github.com/users/chamindias/received_events","type":"User","site_admin":false},"body":"Done in : https://github.com/wso2/product-apim/commit/fe9ce72ac5349b44216835bbbab6a4818db8fff3","created_at":"2015-12-19T10:29:48Z","updated_at":"2015-12-19T10:29:48Z","html_url":"https://github.com/wso2/product-apim/pull/536#discussion_r48091183","pull_request_url":"https://api.github.com/repos/wso2/product-apim/pulls/536","_links":{"self":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/comments/48091183"},"html":{"href":"https://github.com/wso2/product-apim/pull/536#discussion_r48091183"},"pull_request":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/536"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/product-apim/pulls/536","id":53366224,"html_url":"https://github.com/wso2/product-apim/pull/536","diff_url":"https://github.com/wso2/product-apim/pull/536.diff","patch_url":"https://github.com/wso2/product-apim/pull/536.patch","issue_url":"https://api.github.com/repos/wso2/product-apim/issues/536","number":536,"state":"closed","locked":false,"title":"Adding automated test for REST API and upgrade apache cxf version to 3.1.4","user":{"login":"chamindias","id":8359365,"avatar_url":"https://avatars.githubusercontent.com/u/8359365?v=3","gravatar_id":"","url":"https://api.github.com/users/chamindias","html_url":"https://github.com/chamindias","followers_url":"https://api.github.com/users/chamindias/followers","following_url":"https://api.github.com/users/chamindias/following{/other_user}","gists_url":"https://api.github.com/users/chamindias/gists{/gist_id}","starred_url":"https://api.github.com/users/chamindias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamindias/subscriptions","organizations_url":"https://api.github.com/users/chamindias/orgs","repos_url":"https://api.github.com/users/chamindias/repos","events_url":"https://api.github.com/users/chamindias/events{/privacy}","received_events_url":"https://api.github.com/users/chamindias/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-11T08:39:25Z","updated_at":"2015-12-19T10:29:48Z","closed_at":"2015-12-11T08:48:12Z","merged_at":"2015-12-11T08:48:12Z","merge_commit_sha":"2a066ff57a844045faf6a31908487bc9c29604bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/product-apim/pulls/536/commits","review_comments_url":"https://api.github.com/repos/wso2/product-apim/pulls/536/comments","review_comment_url":"https://api.github.com/repos/wso2/product-apim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/product-apim/issues/536/comments","statuses_url":"https://api.github.com/repos/wso2/product-apim/statuses/c4a8d0c1359f49bbdbab4073e40cf565b4b6dcd3","head":{"label":"chamindias:1.10.x","ref":"1.10.x","sha":"c4a8d0c1359f49bbdbab4073e40cf565b4b6dcd3","user":{"login":"chamindias","id":8359365,"avatar_url":"https://avatars.githubusercontent.com/u/8359365?v=3","gravatar_id":"","url":"https://api.github.com/users/chamindias","html_url":"https://github.com/chamindias","followers_url":"https://api.github.com/users/chamindias/followers","following_url":"https://api.github.com/users/chamindias/following{/other_user}","gists_url":"https://api.github.com/users/chamindias/gists{/gist_id}","starred_url":"https://api.github.com/users/chamindias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamindias/subscriptions","organizations_url":"https://api.github.com/users/chamindias/orgs","repos_url":"https://api.github.com/users/chamindias/repos","events_url":"https://api.github.com/users/chamindias/events{/privacy}","received_events_url":"https://api.github.com/users/chamindias/received_events","type":"User","site_admin":false},"repo":{"id":35951222,"name":"product-apim","full_name":"chamindias/product-apim","owner":{"login":"chamindias","id":8359365,"avatar_url":"https://avatars.githubusercontent.com/u/8359365?v=3","gravatar_id":"","url":"https://api.github.com/users/chamindias","html_url":"https://github.com/chamindias","followers_url":"https://api.github.com/users/chamindias/followers","following_url":"https://api.github.com/users/chamindias/following{/other_user}","gists_url":"https://api.github.com/users/chamindias/gists{/gist_id}","starred_url":"https://api.github.com/users/chamindias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamindias/subscriptions","organizations_url":"https://api.github.com/users/chamindias/orgs","repos_url":"https://api.github.com/users/chamindias/repos","events_url":"https://api.github.com/users/chamindias/events{/privacy}","received_events_url":"https://api.github.com/users/chamindias/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chamindias/product-apim","description":"","fork":true,"url":"https://api.github.com/repos/chamindias/product-apim","forks_url":"https://api.github.com/repos/chamindias/product-apim/forks","keys_url":"https://api.github.com/repos/chamindias/product-apim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chamindias/product-apim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chamindias/product-apim/teams","hooks_url":"https://api.github.com/repos/chamindias/product-apim/hooks","issue_events_url":"https://api.github.com/repos/chamindias/product-apim/issues/events{/number}","events_url":"https://api.github.com/repos/chamindias/product-apim/events","assignees_url":"https://api.github.com/repos/chamindias/product-apim/assignees{/user}","branches_url":"https://api.github.com/repos/chamindias/product-apim/branches{/branch}","tags_url":"https://api.github.com/repos/chamindias/product-apim/tags","blobs_url":"https://api.github.com/repos/chamindias/product-apim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chamindias/product-apim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chamindias/product-apim/git/refs{/sha}","trees_url":"https://api.github.com/repos/chamindias/product-apim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chamindias/product-apim/statuses/{sha}","languages_url":"https://api.github.com/repos/chamindias/product-apim/languages","stargazers_url":"https://api.github.com/repos/chamindias/product-apim/stargazers","contributors_url":"https://api.github.com/repos/chamindias/product-apim/contributors","subscribers_url":"https://api.github.com/repos/chamindias/product-apim/subscribers","subscription_url":"https://api.github.com/repos/chamindias/product-apim/subscription","commits_url":"https://api.github.com/repos/chamindias/product-apim/commits{/sha}","git_commits_url":"https://api.github.com/repos/chamindias/product-apim/git/commits{/sha}","comments_url":"https://api.github.com/repos/chamindias/product-apim/comments{/number}","issue_comment_url":"https://api.github.com/repos/chamindias/product-apim/issues/comments{/number}","contents_url":"https://api.github.com/repos/chamindias/product-apim/contents/{+path}","compare_url":"https://api.github.com/repos/chamindias/product-apim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chamindias/product-apim/merges","archive_url":"https://api.github.com/repos/chamindias/product-apim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chamindias/product-apim/downloads","issues_url":"https://api.github.com/repos/chamindias/product-apim/issues{/number}","pulls_url":"https://api.github.com/repos/chamindias/product-apim/pulls{/number}","milestones_url":"https://api.github.com/repos/chamindias/product-apim/milestones{/number}","notifications_url":"https://api.github.com/repos/chamindias/product-apim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chamindias/product-apim/labels{/name}","releases_url":"https://api.github.com/repos/chamindias/product-apim/releases{/id}","created_at":"2015-05-20T13:57:14Z","updated_at":"2015-05-20T13:57:24Z","pushed_at":"2015-12-19T07:47:29Z","git_url":"git://github.com/chamindias/product-apim.git","ssh_url":"git@github.com:chamindias/product-apim.git","clone_url":"https://github.com/chamindias/product-apim.git","svn_url":"https://github.com/chamindias/product-apim","homepage":null,"size":79572,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:1.10.x","ref":"1.10.x","sha":"2dd520c492da5f730f17ddaa4c0f023a4783d1da","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":20717348,"name":"product-apim","full_name":"wso2/product-apim","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/product-apim","description":"","fork":false,"url":"https://api.github.com/repos/wso2/product-apim","forks_url":"https://api.github.com/repos/wso2/product-apim/forks","keys_url":"https://api.github.com/repos/wso2/product-apim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/product-apim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/product-apim/teams","hooks_url":"https://api.github.com/repos/wso2/product-apim/hooks","issue_events_url":"https://api.github.com/repos/wso2/product-apim/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/product-apim/events","assignees_url":"https://api.github.com/repos/wso2/product-apim/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/product-apim/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/product-apim/tags","blobs_url":"https://api.github.com/repos/wso2/product-apim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/product-apim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/product-apim/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/product-apim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/product-apim/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/product-apim/languages","stargazers_url":"https://api.github.com/repos/wso2/product-apim/stargazers","contributors_url":"https://api.github.com/repos/wso2/product-apim/contributors","subscribers_url":"https://api.github.com/repos/wso2/product-apim/subscribers","subscription_url":"https://api.github.com/repos/wso2/product-apim/subscription","commits_url":"https://api.github.com/repos/wso2/product-apim/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/product-apim/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/product-apim/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/product-apim/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/product-apim/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/product-apim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/product-apim/merges","archive_url":"https://api.github.com/repos/wso2/product-apim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/product-apim/downloads","issues_url":"https://api.github.com/repos/wso2/product-apim/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/product-apim/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/product-apim/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/product-apim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/product-apim/labels{/name}","releases_url":"https://api.github.com/repos/wso2/product-apim/releases{/id}","created_at":"2014-06-11T08:05:00Z","updated_at":"2015-12-04T15:58:16Z","pushed_at":"2015-12-18T12:46:44Z","git_url":"git://github.com/wso2/product-apim.git","ssh_url":"git@github.com:wso2/product-apim.git","clone_url":"https://github.com/wso2/product-apim.git","svn_url":"https://github.com/wso2/product-apim","homepage":null,"size":84263,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":17,"forks":101,"open_issues":17,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/536"},"html":{"href":"https://github.com/wso2/product-apim/pull/536"},"issue":{"href":"https://api.github.com/repos/wso2/product-apim/issues/536"},"comments":{"href":"https://api.github.com/repos/wso2/product-apim/issues/536/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/536/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/product-apim/pulls/536/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/product-apim/statuses/c4a8d0c1359f49bbdbab4073e40cf565b4b6dcd3"}}}}