{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/product-ei/pulls/comments/141245864","pull_request_review_id":65429052,"id":141245864,"diff_hunk":"@@ -91,89 +83,64 @@ public void testHttpEndpoint() throws Exception {\n         endpointDeletionScenario();\n     }\n \n-    @Test(groups = {\"wso2.esb\"}, description = \"HTTP Endpoint POST Test: RESTful\", priority = 5)\n+    @Test(groups = { \"wso2.esb\" }, description = \"HTTP Endpoint POST Test: RESTful\", priority = 5)\n     public void testToPost() throws IOException, Exception {\n-        String addStudentData = \"<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-1\\\" ?>\\n\" +\n-                \"   <p:addStudent xmlns:p=\\\"http://axis2.apache.org\\\">\\n\" +\n-                \"      <!--0 to 1 occurrence-->\\n\" +\n-                \"      <ns:student xmlns:ns=\\\"http://axis2.apache.org\\\">\\n\" +\n-                \"         <!--0 to 1 occurrence-->\\n\" +\n-                \"         <xs:age xmlns:xs=\\\"http://axis2.apache.org\\\">100</xs:age>\\n\" +\n-                \"         <!--0 to 1 occurrence-->\\n\" +\n-                \"         <xs:name xmlns:xs=\\\"http://axis2.apache.org\\\">\" + studentName + \"</xs:name>\\n\" +\n-                \"         <!--0 or more occurrences-->\\n\" +\n-                \"         <xs:subjects xmlns:xs=\\\"http://axis2.apache.org\\\">testAutomation</xs:subjects>\\n\" +\n-                \"      </ns:student>\\n\" +\n-                \"   </p:addStudent>\";\n-\n-        StringReader sendData = new StringReader(addStudentData);\n-        StringWriter responseData = new StringWriter();\n-        URL restURL = new URL((getProxyServiceURLHttp(\"postEPProxy\")) + \"/students/\");\n-        HttpURLConnectionClient.sendPostRequest(sendData, restURL, responseData, \"application/xml\");\n-\n-        assertTrue(responseData.toString().contains(studentName), \"response doesn't contain the expected output\");\n+\n+        String createCustomerData =\n+                \"<createCustomer>\\n\" + \"<id>\" + customerId + \"</id>\\n\" + \"<name>\" + customerName + \"</name>\\n\"\n+                        + \"</createCustomer>\";\n+        StringReader customerData = new StringReader(createCustomerData);\n+        StringWriter postResponseData = new StringWriter();\n+        URL postRestURL = new URL((getApiInvocationURL(CUSTOMER_API_CONTEXT)) + RESOURCE_CONTEXT);\n+        System.out.println();\n+        HttpURLConnectionClient.sendPostRequest(customerData, postRestURL, postResponseData, \"application/xml\");\n+        assertTrue(postResponseData.toString().contains(customerName),\n+                \"response doesn't contain the expected output but contains: \" + postResponseData.toString());\n+\n     }\n \n-    @Test(groups = {\"wso2.esb\"}, description = \"HTTP Endpoint GET test: RESTful\", priority = 6, enabled = false)\n+    @Test(groups = { \"wso2.esb\" }, description = \"HTTP Endpoint GET test: RESTful\", priority = 6)\n     public void testToGet() throws IOException {\n-        //check whether the student is added.\n-        String studentGetUri = getProxyServiceURLHttp(\"getEPProxy\") + \"/student/\" + studentName;\n-        HttpResponse getResponse = HttpURLConnectionClient.sendGetRequest(studentGetUri, null);\n-\n-        assertTrue(getResponse.getData().contains(\"<ns:getStudentResponse xmlns:ns=\\\"http://axis2.apache.org\\\"><ns:return>\" +\n-                \"<ns:age>100</ns:age>\" +\n-                \"<ns:name>\" + studentName + \"</ns:name>\" +\n-                \"<ns:subjects>testAutomation</ns:subjects>\" +\n-                \"</ns:return></ns:getStudentResponse>\"));\n+\n+        String getRestURI = getApiInvocationURL(CUSTOMER_API_CONTEXT) + RESOURCE_CONTEXT + \"/\" + customerId;\n+        HttpResponse getResponseData = HttpURLConnectionClient.sendGetRequest(getRestURI, null);\n+        assertTrue(getResponseData.getData().contains(\n+                \"<getCustomerResponse xmlns=\\\"http://ws.apache.org/ns/synapse\\\"><id>8fa3fc1b-f63c-4b21-8aff-3ac684c74d97</id><name>John</name></getCustomerResponse>\"),\n+                \"Unexpected output received:\" + getResponseData.toString());","path":"integration/mediation-tests/tests-service/src/test/java/org/wso2/carbon/esb/endpoint/test/HttpEndpointTestCase.java","position":121,"original_position":122,"commit_id":"ddda14d66cb8f4764098311fb36577fbb77448dd","original_commit_id":"abc84b33f2be81676f112996e873b8a43f7b70d0","user":{"login":"milindaperera","id":7402364,"avatar_url":"https://avatars3.githubusercontent.com/u/7402364?v=4","gravatar_id":"","url":"https://api.github.com/users/milindaperera","html_url":"https://github.com/milindaperera","followers_url":"https://api.github.com/users/milindaperera/followers","following_url":"https://api.github.com/users/milindaperera/following{/other_user}","gists_url":"https://api.github.com/users/milindaperera/gists{/gist_id}","starred_url":"https://api.github.com/users/milindaperera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milindaperera/subscriptions","organizations_url":"https://api.github.com/users/milindaperera/orgs","repos_url":"https://api.github.com/users/milindaperera/repos","events_url":"https://api.github.com/users/milindaperera/events{/privacy}","received_events_url":"https://api.github.com/users/milindaperera/received_events","type":"User","site_admin":false},"body":"Ah got it, for execution, it doesn't make sense, but for readability, I feel it's better if we have variable","created_at":"2017-09-27T05:15:59Z","updated_at":"2017-09-27T05:16:00Z","html_url":"https://github.com/wso2/product-ei/pull/1051#discussion_r141245864","pull_request_url":"https://api.github.com/repos/wso2/product-ei/pulls/1051","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/comments/141245864"},"html":{"href":"https://github.com/wso2/product-ei/pull/1051#discussion_r141245864"},"pull_request":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/1051"}},"in_reply_to_id":141243986},"pull_request":{"url":"https://api.github.com/repos/wso2/product-ei/pulls/1051","id":143297696,"html_url":"https://github.com/wso2/product-ei/pull/1051","diff_url":"https://github.com/wso2/product-ei/pull/1051.diff","patch_url":"https://github.com/wso2/product-ei/pull/1051.patch","issue_url":"https://api.github.com/repos/wso2/product-ei/issues/1051","number":1051,"state":"open","locked":false,"title":"Refactor HttpEndpointTestCase.java","user":{"login":"himasha","id":9687840,"avatar_url":"https://avatars1.githubusercontent.com/u/9687840?v=4","gravatar_id":"","url":"https://api.github.com/users/himasha","html_url":"https://github.com/himasha","followers_url":"https://api.github.com/users/himasha/followers","following_url":"https://api.github.com/users/himasha/following{/other_user}","gists_url":"https://api.github.com/users/himasha/gists{/gist_id}","starred_url":"https://api.github.com/users/himasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himasha/subscriptions","organizations_url":"https://api.github.com/users/himasha/orgs","repos_url":"https://api.github.com/users/himasha/repos","events_url":"https://api.github.com/users/himasha/events{/privacy}","received_events_url":"https://api.github.com/users/himasha/received_events","type":"User","site_admin":false},"body":"This includes refactoring existing tests to follow new naming patterns as well as fixing and enabling disabled tests for CRUD operations with HttpEndpoints.","created_at":"2017-09-27T04:46:28Z","updated_at":"2017-09-27T05:16:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ad21e8fee925b917679e44e63b6b2fc9ee13b96","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/product-ei/pulls/1051/commits","review_comments_url":"https://api.github.com/repos/wso2/product-ei/pulls/1051/comments","review_comment_url":"https://api.github.com/repos/wso2/product-ei/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/product-ei/issues/1051/comments","statuses_url":"https://api.github.com/repos/wso2/product-ei/statuses/ddda14d66cb8f4764098311fb36577fbb77448dd","head":{"label":"himasha:test-coverage","ref":"test-coverage","sha":"ddda14d66cb8f4764098311fb36577fbb77448dd","user":{"login":"himasha","id":9687840,"avatar_url":"https://avatars1.githubusercontent.com/u/9687840?v=4","gravatar_id":"","url":"https://api.github.com/users/himasha","html_url":"https://github.com/himasha","followers_url":"https://api.github.com/users/himasha/followers","following_url":"https://api.github.com/users/himasha/following{/other_user}","gists_url":"https://api.github.com/users/himasha/gists{/gist_id}","starred_url":"https://api.github.com/users/himasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himasha/subscriptions","organizations_url":"https://api.github.com/users/himasha/orgs","repos_url":"https://api.github.com/users/himasha/repos","events_url":"https://api.github.com/users/himasha/events{/privacy}","received_events_url":"https://api.github.com/users/himasha/received_events","type":"User","site_admin":false},"repo":{"id":92713039,"name":"product-ei","full_name":"himasha/product-ei","owner":{"login":"himasha","id":9687840,"avatar_url":"https://avatars1.githubusercontent.com/u/9687840?v=4","gravatar_id":"","url":"https://api.github.com/users/himasha","html_url":"https://github.com/himasha","followers_url":"https://api.github.com/users/himasha/followers","following_url":"https://api.github.com/users/himasha/following{/other_user}","gists_url":"https://api.github.com/users/himasha/gists{/gist_id}","starred_url":"https://api.github.com/users/himasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himasha/subscriptions","organizations_url":"https://api.github.com/users/himasha/orgs","repos_url":"https://api.github.com/users/himasha/repos","events_url":"https://api.github.com/users/himasha/events{/privacy}","received_events_url":"https://api.github.com/users/himasha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/himasha/product-ei","description":null,"fork":true,"url":"https://api.github.com/repos/himasha/product-ei","forks_url":"https://api.github.com/repos/himasha/product-ei/forks","keys_url":"https://api.github.com/repos/himasha/product-ei/keys{/key_id}","collaborators_url":"https://api.github.com/repos/himasha/product-ei/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/himasha/product-ei/teams","hooks_url":"https://api.github.com/repos/himasha/product-ei/hooks","issue_events_url":"https://api.github.com/repos/himasha/product-ei/issues/events{/number}","events_url":"https://api.github.com/repos/himasha/product-ei/events","assignees_url":"https://api.github.com/repos/himasha/product-ei/assignees{/user}","branches_url":"https://api.github.com/repos/himasha/product-ei/branches{/branch}","tags_url":"https://api.github.com/repos/himasha/product-ei/tags","blobs_url":"https://api.github.com/repos/himasha/product-ei/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/himasha/product-ei/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/himasha/product-ei/git/refs{/sha}","trees_url":"https://api.github.com/repos/himasha/product-ei/git/trees{/sha}","statuses_url":"https://api.github.com/repos/himasha/product-ei/statuses/{sha}","languages_url":"https://api.github.com/repos/himasha/product-ei/languages","stargazers_url":"https://api.github.com/repos/himasha/product-ei/stargazers","contributors_url":"https://api.github.com/repos/himasha/product-ei/contributors","subscribers_url":"https://api.github.com/repos/himasha/product-ei/subscribers","subscription_url":"https://api.github.com/repos/himasha/product-ei/subscription","commits_url":"https://api.github.com/repos/himasha/product-ei/commits{/sha}","git_commits_url":"https://api.github.com/repos/himasha/product-ei/git/commits{/sha}","comments_url":"https://api.github.com/repos/himasha/product-ei/comments{/number}","issue_comment_url":"https://api.github.com/repos/himasha/product-ei/issues/comments{/number}","contents_url":"https://api.github.com/repos/himasha/product-ei/contents/{+path}","compare_url":"https://api.github.com/repos/himasha/product-ei/compare/{base}...{head}","merges_url":"https://api.github.com/repos/himasha/product-ei/merges","archive_url":"https://api.github.com/repos/himasha/product-ei/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/himasha/product-ei/downloads","issues_url":"https://api.github.com/repos/himasha/product-ei/issues{/number}","pulls_url":"https://api.github.com/repos/himasha/product-ei/pulls{/number}","milestones_url":"https://api.github.com/repos/himasha/product-ei/milestones{/number}","notifications_url":"https://api.github.com/repos/himasha/product-ei/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/himasha/product-ei/labels{/name}","releases_url":"https://api.github.com/repos/himasha/product-ei/releases{/id}","deployments_url":"https://api.github.com/repos/himasha/product-ei/deployments","created_at":"2017-05-29T06:33:28Z","updated_at":"2017-05-29T06:33:49Z","pushed_at":"2017-09-27T04:50:31Z","git_url":"git://github.com/himasha/product-ei.git","ssh_url":"git@github.com:himasha/product-ei.git","clone_url":"https://github.com/himasha/product-ei.git","svn_url":"https://github.com/himasha/product-ei","homepage":null,"size":36945,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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:master","ref":"master","sha":"14592796a13f8272e2cf8bf43a84ad65653c263b","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars3.githubusercontent.com/u/533043?v=4","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":77035252,"name":"product-ei","full_name":"wso2/product-ei","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars3.githubusercontent.com/u/533043?v=4","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-ei","description":null,"fork":false,"url":"https://api.github.com/repos/wso2/product-ei","forks_url":"https://api.github.com/repos/wso2/product-ei/forks","keys_url":"https://api.github.com/repos/wso2/product-ei/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/product-ei/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/product-ei/teams","hooks_url":"https://api.github.com/repos/wso2/product-ei/hooks","issue_events_url":"https://api.github.com/repos/wso2/product-ei/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/product-ei/events","assignees_url":"https://api.github.com/repos/wso2/product-ei/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/product-ei/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/product-ei/tags","blobs_url":"https://api.github.com/repos/wso2/product-ei/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/product-ei/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/product-ei/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/product-ei/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/product-ei/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/product-ei/languages","stargazers_url":"https://api.github.com/repos/wso2/product-ei/stargazers","contributors_url":"https://api.github.com/repos/wso2/product-ei/contributors","subscribers_url":"https://api.github.com/repos/wso2/product-ei/subscribers","subscription_url":"https://api.github.com/repos/wso2/product-ei/subscription","commits_url":"https://api.github.com/repos/wso2/product-ei/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/product-ei/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/product-ei/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/product-ei/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/product-ei/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/product-ei/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/product-ei/merges","archive_url":"https://api.github.com/repos/wso2/product-ei/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/product-ei/downloads","issues_url":"https://api.github.com/repos/wso2/product-ei/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/product-ei/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/product-ei/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/product-ei/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/product-ei/labels{/name}","releases_url":"https://api.github.com/repos/wso2/product-ei/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/product-ei/deployments","created_at":"2016-12-21T09:00:01Z","updated_at":"2017-08-31T21:14:24Z","pushed_at":"2017-09-27T04:50:32Z","git_url":"git://github.com/wso2/product-ei.git","ssh_url":"git@github.com:wso2/product-ei.git","clone_url":"https://github.com/wso2/product-ei.git","svn_url":"https://github.com/wso2/product-ei","homepage":null,"size":38582,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":180,"forks":55,"open_issues":180,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/1051"},"html":{"href":"https://github.com/wso2/product-ei/pull/1051"},"issue":{"href":"https://api.github.com/repos/wso2/product-ei/issues/1051"},"comments":{"href":"https://api.github.com/repos/wso2/product-ei/issues/1051/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/1051/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/product-ei/pulls/1051/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/product-ei/statuses/ddda14d66cb8f4764098311fb36577fbb77448dd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"milindaperera"}}