{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/comments/170808908","pull_request_review_id":99551263,"id":170808908,"diff_hunk":"@@ -0,0 +1,109 @@\n+/*\n+*  Copyright (c) 2017, 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+package org.apache.synapse.config.xml;\n+\n+import org.apache.axiom.om.OMElement;\n+import org.apache.axiom.om.util.AXIOMUtil;\n+import org.apache.synapse.Mediator;\n+import org.apache.synapse.mediators.bean.BeanMediator;\n+import org.junit.Assert;\n+import org.junit.Test;\n+\n+import javax.xml.stream.XMLStreamException;\n+\n+/**\n+ * This is the test class for BeanMediatorFactory class.\n+ */\n+public class BeanMediatorFactoryTest {\n+\n+    /**\n+     * Creating a bean mediator and asserting it is created successfully.\n+     *\n+     * @throws XMLStreamException - XMLStreamException.\n+     */\n+    @Test\n+    public void testCreateSpecificMediator() throws XMLStreamException {\n+        BeanMediatorFactory beanMediatorFactory = new BeanMediatorFactory();\n+        String inputXML = \"<bean action=\\\"CREATE\\\" class=\\\"org.apache.synapse.util.TestTask\\\" \" +\n+                \"var=\\\"loc\\\"></bean>\";\n+        OMElement element = AXIOMUtil.stringToOM(inputXML);\n+        Mediator mediator = beanMediatorFactory.createSpecificMediator(element, null);\n+        Assert.assertTrue(\"BeanMediator is not created successfully.\", mediator instanceof\n+                BeanMediator);\n+        BeanMediator beanMediator = (BeanMediator) mediator;\n+        Assert.assertEquals(\"CREATE action is not set\", BeanMediator.Action.CREATE, beanMediator.getAction());\n+    }\n+\n+    /**\n+     * Setting property of BeanMediator and asserting the action.\n+     *\n+     * @throws XMLStreamException - XMLStreamException.\n+     */\n+    @Test\n+    public void testCreateSpecificMediator2() throws XMLStreamException {\n+        BeanMediatorFactory beanMediatorFactory = new BeanMediatorFactory();\n+        String inputXML = \"<bean action=\\\"SET_PROPERTY\\\" property=\\\"latitude\\\" value=\\\"{//latitude}\\\" var=\\\"loc\\\" \" +\n+                \"xmlns:ns3=\\\"http://org.apache.synapse/xsd\\\"             \" +\n+                \"xmlns:ns=\\\"http://org.apache.synapse/xsd\\\"></bean>\\n\";\n+        OMElement element = AXIOMUtil.stringToOM(inputXML);\n+        Mediator mediator = beanMediatorFactory.createSpecificMediator(element, null);\n+        Assert.assertTrue(\"BeanMediator is not created successfully.\", mediator instanceof\n+                BeanMediator);","path":"modules/core/src/test/java/org/apache/synapse/config/xml/BeanMediatorFactoryTest.java","position":66,"original_position":66,"commit_id":"8ca9a2b566063a71688a408f36268684304ead46","original_commit_id":"8ca9a2b566063a71688a408f36268684304ead46","user":{"login":"Asitha","id":919462,"avatar_url":"https://avatars3.githubusercontent.com/u/919462?v=4","gravatar_id":"","url":"https://api.github.com/users/Asitha","html_url":"https://github.com/Asitha","followers_url":"https://api.github.com/users/Asitha/followers","following_url":"https://api.github.com/users/Asitha/following{/other_user}","gists_url":"https://api.github.com/users/Asitha/gists{/gist_id}","starred_url":"https://api.github.com/users/Asitha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Asitha/subscriptions","organizations_url":"https://api.github.com/users/Asitha/orgs","repos_url":"https://api.github.com/users/Asitha/repos","events_url":"https://api.github.com/users/Asitha/events{/privacy}","received_events_url":"https://api.github.com/users/Asitha/received_events","type":"User","site_admin":false},"body":"Shall we correct this line segment as follows, to make it more readable?","created_at":"2018-02-27T03:49:50Z","updated_at":"2018-02-27T03:49:50Z","html_url":"https://github.com/wso2/wso2-synapse/pull/930#discussion_r170808908","pull_request_url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/comments/170808908"},"html":{"href":"https://github.com/wso2/wso2-synapse/pull/930#discussion_r170808908"},"pull_request":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930","id":151297775,"html_url":"https://github.com/wso2/wso2-synapse/pull/930","diff_url":"https://github.com/wso2/wso2-synapse/pull/930.diff","patch_url":"https://github.com/wso2/wso2-synapse/pull/930.patch","issue_url":"https://api.github.com/repos/wso2/wso2-synapse/issues/930","number":930,"state":"closed","locked":false,"title":"Add unit tests for BeanMediatorFactory ","user":{"login":"Nirothipan","id":24619763,"avatar_url":"https://avatars1.githubusercontent.com/u/24619763?v=4","gravatar_id":"","url":"https://api.github.com/users/Nirothipan","html_url":"https://github.com/Nirothipan","followers_url":"https://api.github.com/users/Nirothipan/followers","following_url":"https://api.github.com/users/Nirothipan/following{/other_user}","gists_url":"https://api.github.com/users/Nirothipan/gists{/gist_id}","starred_url":"https://api.github.com/users/Nirothipan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nirothipan/subscriptions","organizations_url":"https://api.github.com/users/Nirothipan/orgs","repos_url":"https://api.github.com/users/Nirothipan/repos","events_url":"https://api.github.com/users/Nirothipan/events{/privacy}","received_events_url":"https://api.github.com/users/Nirothipan/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n> Add unit tests for BeanMediatorFactory\r\n\r\n## Goals\r\n> Improve unit test coverage\r\n\r\n## Automation tests\r\n - Unit tests \r\n> 78%\r\n   \r\n## Test environment\r\n> JDK 8, ubuntu 16.04\r\n ","created_at":"2017-11-08T05:41:35Z","updated_at":"2018-02-27T03:49:50Z","closed_at":"2017-11-09T12:42:05Z","merged_at":"2017-11-09T12:42:04Z","merge_commit_sha":"4cd11a7da7faf720173efbb7e8f05deb9f157f25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930/commits","review_comments_url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930/comments","review_comment_url":"https://api.github.com/repos/wso2/wso2-synapse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/wso2-synapse/issues/930/comments","statuses_url":"https://api.github.com/repos/wso2/wso2-synapse/statuses/8ca9a2b566063a71688a408f36268684304ead46","head":{"label":"Nirothipan:BeanMediatorFactoryTest","ref":"BeanMediatorFactoryTest","sha":"8ca9a2b566063a71688a408f36268684304ead46","user":{"login":"Nirothipan","id":24619763,"avatar_url":"https://avatars1.githubusercontent.com/u/24619763?v=4","gravatar_id":"","url":"https://api.github.com/users/Nirothipan","html_url":"https://github.com/Nirothipan","followers_url":"https://api.github.com/users/Nirothipan/followers","following_url":"https://api.github.com/users/Nirothipan/following{/other_user}","gists_url":"https://api.github.com/users/Nirothipan/gists{/gist_id}","starred_url":"https://api.github.com/users/Nirothipan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nirothipan/subscriptions","organizations_url":"https://api.github.com/users/Nirothipan/orgs","repos_url":"https://api.github.com/users/Nirothipan/repos","events_url":"https://api.github.com/users/Nirothipan/events{/privacy}","received_events_url":"https://api.github.com/users/Nirothipan/received_events","type":"User","site_admin":false},"repo":{"id":108224265,"name":"wso2-synapse","full_name":"Nirothipan/wso2-synapse","owner":{"login":"Nirothipan","id":24619763,"avatar_url":"https://avatars1.githubusercontent.com/u/24619763?v=4","gravatar_id":"","url":"https://api.github.com/users/Nirothipan","html_url":"https://github.com/Nirothipan","followers_url":"https://api.github.com/users/Nirothipan/followers","following_url":"https://api.github.com/users/Nirothipan/following{/other_user}","gists_url":"https://api.github.com/users/Nirothipan/gists{/gist_id}","starred_url":"https://api.github.com/users/Nirothipan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nirothipan/subscriptions","organizations_url":"https://api.github.com/users/Nirothipan/orgs","repos_url":"https://api.github.com/users/Nirothipan/repos","events_url":"https://api.github.com/users/Nirothipan/events{/privacy}","received_events_url":"https://api.github.com/users/Nirothipan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nirothipan/wso2-synapse","description":null,"fork":true,"url":"https://api.github.com/repos/Nirothipan/wso2-synapse","forks_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/forks","keys_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/teams","hooks_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/hooks","issue_events_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/issues/events{/number}","events_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/events","assignees_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/assignees{/user}","branches_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/branches{/branch}","tags_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/tags","blobs_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/statuses/{sha}","languages_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/languages","stargazers_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/stargazers","contributors_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/contributors","subscribers_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/subscribers","subscription_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/subscription","commits_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/contents/{+path}","compare_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/merges","archive_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/downloads","issues_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/issues{/number}","pulls_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/pulls{/number}","milestones_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/milestones{/number}","notifications_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/labels{/name}","releases_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/releases{/id}","deployments_url":"https://api.github.com/repos/Nirothipan/wso2-synapse/deployments","created_at":"2017-10-25T05:34:59Z","updated_at":"2017-10-25T05:35:06Z","pushed_at":"2017-11-10T13:15:05Z","git_url":"git://github.com/Nirothipan/wso2-synapse.git","ssh_url":"git@github.com:Nirothipan/wso2-synapse.git","clone_url":"https://github.com/Nirothipan/wso2-synapse.git","svn_url":"https://github.com/Nirothipan/wso2-synapse","homepage":null,"size":14118,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"b2e848c6b48e4d68bf4949a37282788f27769228","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":16471584,"name":"wso2-synapse","full_name":"wso2/wso2-synapse","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/wso2-synapse","description":null,"fork":false,"url":"https://api.github.com/repos/wso2/wso2-synapse","forks_url":"https://api.github.com/repos/wso2/wso2-synapse/forks","keys_url":"https://api.github.com/repos/wso2/wso2-synapse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/wso2-synapse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/wso2-synapse/teams","hooks_url":"https://api.github.com/repos/wso2/wso2-synapse/hooks","issue_events_url":"https://api.github.com/repos/wso2/wso2-synapse/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/wso2-synapse/events","assignees_url":"https://api.github.com/repos/wso2/wso2-synapse/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/wso2-synapse/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/wso2-synapse/tags","blobs_url":"https://api.github.com/repos/wso2/wso2-synapse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/wso2-synapse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/wso2-synapse/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/wso2-synapse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/wso2-synapse/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/wso2-synapse/languages","stargazers_url":"https://api.github.com/repos/wso2/wso2-synapse/stargazers","contributors_url":"https://api.github.com/repos/wso2/wso2-synapse/contributors","subscribers_url":"https://api.github.com/repos/wso2/wso2-synapse/subscribers","subscription_url":"https://api.github.com/repos/wso2/wso2-synapse/subscription","commits_url":"https://api.github.com/repos/wso2/wso2-synapse/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/wso2-synapse/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/wso2-synapse/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/wso2-synapse/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/wso2-synapse/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/wso2-synapse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/wso2-synapse/merges","archive_url":"https://api.github.com/repos/wso2/wso2-synapse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/wso2-synapse/downloads","issues_url":"https://api.github.com/repos/wso2/wso2-synapse/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/wso2-synapse/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/wso2-synapse/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/wso2-synapse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/wso2-synapse/labels{/name}","releases_url":"https://api.github.com/repos/wso2/wso2-synapse/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/wso2-synapse/deployments","created_at":"2014-02-03T06:28:42Z","updated_at":"2018-02-24T07:55:42Z","pushed_at":"2018-02-26T07:06:39Z","git_url":"git://github.com/wso2/wso2-synapse.git","ssh_url":"git@github.com:wso2/wso2-synapse.git","clone_url":"https://github.com/wso2/wso2-synapse.git","svn_url":"https://github.com/wso2/wso2-synapse","homepage":null,"size":14597,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":276,"open_issues":3,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930"},"html":{"href":"https://github.com/wso2/wso2-synapse/pull/930"},"issue":{"href":"https://api.github.com/repos/wso2/wso2-synapse/issues/930"},"comments":{"href":"https://api.github.com/repos/wso2/wso2-synapse/issues/930/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/wso2-synapse/pulls/930/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/wso2-synapse/statuses/8ca9a2b566063a71688a408f36268684304ead46"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Asitha"}}