{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/product-greg/pulls/comments/47464168","id":47464168,"diff_hunk":"@@ -0,0 +1,351 @@\n+/*\n+*Copyright (c) 2005-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.carbon.registry.es.notifications;\n+\n+import org.apache.wink.client.ClientResponse;\n+import org.json.JSONArray;\n+import org.json.JSONException;\n+import org.json.JSONObject;\n+import org.testng.annotations.*;\n+import org.wso2.carbon.automation.engine.configurations.UrlGenerationUtil;\n+import org.wso2.carbon.automation.engine.context.TestUserMode;\n+import org.wso2.carbon.automation.engine.frameworkutils.FrameworkPathUtil;\n+import org.wso2.carbon.automation.test.utils.common.TestConfigurationProvider;\n+import org.wso2.carbon.identity.user.profile.stub.UserProfileMgtServiceUserProfileExceptionException;\n+import org.wso2.carbon.identity.user.profile.stub.types.UserFieldDTO;\n+import org.wso2.carbon.identity.user.profile.stub.types.UserProfileDTO;\n+import org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException;\n+import org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager;\n+import org.wso2.carbon.registry.core.exceptions.RegistryException;\n+import org.wso2.carbon.registry.es.utils.EmailUtil;\n+import org.wso2.greg.integration.common.clients.UserProfileMgtServiceClient;\n+import org.wso2.greg.integration.common.utils.GREGIntegrationBaseTest;\n+import org.wso2.greg.integration.common.utils.GenericRestClient;\n+\n+import javax.ws.rs.core.MediaType;\n+import javax.xml.xpath.XPathExpressionException;\n+import java.io.File;\n+import java.io.IOException;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import static org.testng.Assert.assertNotNull;\n+import static org.testng.Assert.assertTrue;\n+\n+/**\n+ * This test class can be used to check the email notification functionality\n+ */\n+public class SoapServiceEmailNotificationTestCase extends GREGIntegrationBaseTest {\n+\n+    private TestUserMode userMode;\n+    String jSessionId;\n+    private UserProfileMgtServiceClient userProfileMgtClient;\n+    private File axis2File;\n+    private String publisherUrl;\n+    private String resourcePath;\n+    private String assetId;\n+    private String cookieHeader;\n+    private GenericRestClient genericRestClient;\n+    private Map<String, String> queryParamMap;\n+    private Map<String, String> headerMap;\n+    private String loginURL;\n+    private String emailAddress;\n+    private EmailUtil emailUtil;\n+    boolean isNotificationMailAvailable;\n+\n+\n+    @Factory(dataProvider = \"userModeProvider\")\n+    public SoapServiceEmailNotificationTestCase(TestUserMode userMode) {\n+        this.userMode = userMode;\n+    }\n+\n+    @BeforeClass(alwaysRun = true)\n+    public void init() throws Exception {\n+\n+        super.init(userMode);\n+        loginURL = UrlGenerationUtil.getLoginURL(automationContext.getInstance());\n+        emailAddress = \"gregtestes@gmail.com\";\n+        genericRestClient = new GenericRestClient();\n+        queryParamMap = new HashMap<>();\n+        headerMap = new HashMap<>();\n+        resourcePath =\n+                FrameworkPathUtil.getSystemResourceLocation() + \"artifacts\" + File.separator + \"GREG\" + File.separator;\n+        publisherUrl = automationContext.getContextUrls().getSecureServiceUrl().replace(\"services\", \"publisher/apis\");\n+        userProfileMgtClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);\n+        axis2File = new File(\n+                TestConfigurationProvider.getResourceLocation(\"GREG\") + File.separator + \"axis2\" + File.separator\n+                        + \"axis2.xml\");","path":"modules/integration/tests-integration/tests-es/src/test/java/org/wso2/carbon/registry/es/notifications/SoapServiceEmailNotificationTestCase.java","position":93,"original_position":93,"commit_id":"78966c7c6691770cc2bc1b0fdae99a22e8945f79","original_commit_id":"78966c7c6691770cc2bc1b0fdae99a22e8945f79","user":{"login":"Rajith90","id":12757270,"avatar_url":"https://avatars.githubusercontent.com/u/12757270?v=3","gravatar_id":"","url":"https://api.github.com/users/Rajith90","html_url":"https://github.com/Rajith90","followers_url":"https://api.github.com/users/Rajith90/followers","following_url":"https://api.github.com/users/Rajith90/following{/other_user}","gists_url":"https://api.github.com/users/Rajith90/gists{/gist_id}","starred_url":"https://api.github.com/users/Rajith90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rajith90/subscriptions","organizations_url":"https://api.github.com/users/Rajith90/orgs","repos_url":"https://api.github.com/users/Rajith90/repos","events_url":"https://api.github.com/users/Rajith90/events{/privacy}","received_events_url":"https://api.github.com/users/Rajith90/received_events","type":"User","site_admin":false},"body":"Used String builder for the string appending. Refer PR #343","created_at":"2015-12-14T06:15:23Z","updated_at":"2015-12-14T06:15:23Z","html_url":"https://github.com/wso2/product-greg/pull/288#discussion_r47464168","pull_request_url":"https://api.github.com/repos/wso2/product-greg/pulls/288","_links":{"self":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/comments/47464168"},"html":{"href":"https://github.com/wso2/product-greg/pull/288#discussion_r47464168"},"pull_request":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/288"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/product-greg/pulls/288","id":50244844,"html_url":"https://github.com/wso2/product-greg/pull/288","diff_url":"https://github.com/wso2/product-greg/pull/288.diff","patch_url":"https://github.com/wso2/product-greg/pull/288.patch","issue_url":"https://api.github.com/repos/wso2/product-greg/issues/288","number":288,"state":"closed","locked":false,"title":"Soap Service E-mail Notification Test Case","user":{"login":"Rajith90","id":12757270,"avatar_url":"https://avatars.githubusercontent.com/u/12757270?v=3","gravatar_id":"","url":"https://api.github.com/users/Rajith90","html_url":"https://github.com/Rajith90","followers_url":"https://api.github.com/users/Rajith90/followers","following_url":"https://api.github.com/users/Rajith90/following{/other_user}","gists_url":"https://api.github.com/users/Rajith90/gists{/gist_id}","starred_url":"https://api.github.com/users/Rajith90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rajith90/subscriptions","organizations_url":"https://api.github.com/users/Rajith90/orgs","repos_url":"https://api.github.com/users/Rajith90/repos","events_url":"https://api.github.com/users/Rajith90/events{/privacy}","received_events_url":"https://api.github.com/users/Rajith90/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-10T11:54:33Z","updated_at":"2015-12-14T06:15:23Z","closed_at":"2015-11-10T11:55:01Z","merged_at":"2015-11-10T11:55:01Z","merge_commit_sha":"f98491f0d108514ad6e118f7addccdd956bab364","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/product-greg/pulls/288/commits","review_comments_url":"https://api.github.com/repos/wso2/product-greg/pulls/288/comments","review_comment_url":"https://api.github.com/repos/wso2/product-greg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/product-greg/issues/288/comments","statuses_url":"https://api.github.com/repos/wso2/product-greg/statuses/78966c7c6691770cc2bc1b0fdae99a22e8945f79","head":{"label":"Rajith90:test_es","ref":"test_es","sha":"78966c7c6691770cc2bc1b0fdae99a22e8945f79","user":{"login":"Rajith90","id":12757270,"avatar_url":"https://avatars.githubusercontent.com/u/12757270?v=3","gravatar_id":"","url":"https://api.github.com/users/Rajith90","html_url":"https://github.com/Rajith90","followers_url":"https://api.github.com/users/Rajith90/followers","following_url":"https://api.github.com/users/Rajith90/following{/other_user}","gists_url":"https://api.github.com/users/Rajith90/gists{/gist_id}","starred_url":"https://api.github.com/users/Rajith90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rajith90/subscriptions","organizations_url":"https://api.github.com/users/Rajith90/orgs","repos_url":"https://api.github.com/users/Rajith90/repos","events_url":"https://api.github.com/users/Rajith90/events{/privacy}","received_events_url":"https://api.github.com/users/Rajith90/received_events","type":"User","site_admin":false},"repo":{"id":37707838,"name":"product-greg","full_name":"Rajith90/product-greg","owner":{"login":"Rajith90","id":12757270,"avatar_url":"https://avatars.githubusercontent.com/u/12757270?v=3","gravatar_id":"","url":"https://api.github.com/users/Rajith90","html_url":"https://github.com/Rajith90","followers_url":"https://api.github.com/users/Rajith90/followers","following_url":"https://api.github.com/users/Rajith90/following{/other_user}","gists_url":"https://api.github.com/users/Rajith90/gists{/gist_id}","starred_url":"https://api.github.com/users/Rajith90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rajith90/subscriptions","organizations_url":"https://api.github.com/users/Rajith90/orgs","repos_url":"https://api.github.com/users/Rajith90/repos","events_url":"https://api.github.com/users/Rajith90/events{/privacy}","received_events_url":"https://api.github.com/users/Rajith90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Rajith90/product-greg","description":"","fork":true,"url":"https://api.github.com/repos/Rajith90/product-greg","forks_url":"https://api.github.com/repos/Rajith90/product-greg/forks","keys_url":"https://api.github.com/repos/Rajith90/product-greg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rajith90/product-greg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rajith90/product-greg/teams","hooks_url":"https://api.github.com/repos/Rajith90/product-greg/hooks","issue_events_url":"https://api.github.com/repos/Rajith90/product-greg/issues/events{/number}","events_url":"https://api.github.com/repos/Rajith90/product-greg/events","assignees_url":"https://api.github.com/repos/Rajith90/product-greg/assignees{/user}","branches_url":"https://api.github.com/repos/Rajith90/product-greg/branches{/branch}","tags_url":"https://api.github.com/repos/Rajith90/product-greg/tags","blobs_url":"https://api.github.com/repos/Rajith90/product-greg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rajith90/product-greg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rajith90/product-greg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rajith90/product-greg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rajith90/product-greg/statuses/{sha}","languages_url":"https://api.github.com/repos/Rajith90/product-greg/languages","stargazers_url":"https://api.github.com/repos/Rajith90/product-greg/stargazers","contributors_url":"https://api.github.com/repos/Rajith90/product-greg/contributors","subscribers_url":"https://api.github.com/repos/Rajith90/product-greg/subscribers","subscription_url":"https://api.github.com/repos/Rajith90/product-greg/subscription","commits_url":"https://api.github.com/repos/Rajith90/product-greg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rajith90/product-greg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rajith90/product-greg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rajith90/product-greg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rajith90/product-greg/contents/{+path}","compare_url":"https://api.github.com/repos/Rajith90/product-greg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rajith90/product-greg/merges","archive_url":"https://api.github.com/repos/Rajith90/product-greg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rajith90/product-greg/downloads","issues_url":"https://api.github.com/repos/Rajith90/product-greg/issues{/number}","pulls_url":"https://api.github.com/repos/Rajith90/product-greg/pulls{/number}","milestones_url":"https://api.github.com/repos/Rajith90/product-greg/milestones{/number}","notifications_url":"https://api.github.com/repos/Rajith90/product-greg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rajith90/product-greg/labels{/name}","releases_url":"https://api.github.com/repos/Rajith90/product-greg/releases{/id}","created_at":"2015-06-19T07:20:04Z","updated_at":"2015-06-19T07:20:20Z","pushed_at":"2015-12-14T05:35:51Z","git_url":"git://github.com/Rajith90/product-greg.git","ssh_url":"git@github.com:Rajith90/product-greg.git","clone_url":"https://github.com/Rajith90/product-greg.git","svn_url":"https://github.com/Rajith90/product-greg","homepage":null,"size":34518,"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:integration-test-hackthone","ref":"integration-test-hackthone","sha":"ba5641a45b6657daf47dd2025c325a4b7b9e70fe","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":16977759,"name":"product-greg","full_name":"wso2/product-greg","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-greg","description":"","fork":false,"url":"https://api.github.com/repos/wso2/product-greg","forks_url":"https://api.github.com/repos/wso2/product-greg/forks","keys_url":"https://api.github.com/repos/wso2/product-greg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/product-greg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/product-greg/teams","hooks_url":"https://api.github.com/repos/wso2/product-greg/hooks","issue_events_url":"https://api.github.com/repos/wso2/product-greg/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/product-greg/events","assignees_url":"https://api.github.com/repos/wso2/product-greg/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/product-greg/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/product-greg/tags","blobs_url":"https://api.github.com/repos/wso2/product-greg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/product-greg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/product-greg/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/product-greg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/product-greg/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/product-greg/languages","stargazers_url":"https://api.github.com/repos/wso2/product-greg/stargazers","contributors_url":"https://api.github.com/repos/wso2/product-greg/contributors","subscribers_url":"https://api.github.com/repos/wso2/product-greg/subscribers","subscription_url":"https://api.github.com/repos/wso2/product-greg/subscription","commits_url":"https://api.github.com/repos/wso2/product-greg/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/product-greg/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/product-greg/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/product-greg/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/product-greg/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/product-greg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/product-greg/merges","archive_url":"https://api.github.com/repos/wso2/product-greg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/product-greg/downloads","issues_url":"https://api.github.com/repos/wso2/product-greg/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/product-greg/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/product-greg/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/product-greg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/product-greg/labels{/name}","releases_url":"https://api.github.com/repos/wso2/product-greg/releases{/id}","created_at":"2014-02-19T08:15:10Z","updated_at":"2015-11-03T03:27:17Z","pushed_at":"2015-12-14T05:38:24Z","git_url":"git://github.com/wso2/product-greg.git","ssh_url":"git@github.com:wso2/product-greg.git","clone_url":"https://github.com/wso2/product-greg.git","svn_url":"https://github.com/wso2/product-greg","homepage":null,"size":34718,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":21,"forks":52,"open_issues":21,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/288"},"html":{"href":"https://github.com/wso2/product-greg/pull/288"},"issue":{"href":"https://api.github.com/repos/wso2/product-greg/issues/288"},"comments":{"href":"https://api.github.com/repos/wso2/product-greg/issues/288/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/288/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/product-greg/pulls/288/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/product-greg/statuses/78966c7c6691770cc2bc1b0fdae99a22e8945f79"}}}}