{"action":"created","comment":{"url":"https://api.github.com/repos/yonadev/yona-server/pulls/comments/45577423","id":45577423,"diff_hunk":"@@ -0,0 +1,200 @@\n+package nu.yona.server\n+\n+import groovy.json.*\n+import spock.lang.Shared\n+import spock.lang.Specification\n+\n+class RejectBuddyTest extends Specification {\n+\n+    def appServiceBaseURL = System.properties.'yona.appservice.url'\n+    def YonaServer appService = new YonaServer(appServiceBaseURL)\n+    @Shared\n+    def timestamp = YonaServer.getTimeStamp()\n+\n+    @Shared\n+    def richardQuinPassword = \"R i c h a r d\"\n+    def bobDunnPassword = \"B o b\"\n+    @Shared\n+    def richardQuinURL\n+    @Shared\n+    def richardQuinLoginID\n+    @Shared\n+    def bobDunnURL\n+    @Shared\n+    def bobDunnLoginID\n+    @Shared\n+    def richardQuinBobBuddyURL\n+    @Shared\n+    def bobDunnRichardBuddyURL\n+    @Shared\n+    def bobDunnBuddyMessageRejectURL\n+    @Shared\n+    def bobDunnBuddyMessageProcessURL\n+    @Shared\n+    def richardQuinBuddyMessageRejectURL\n+    @Shared\n+    def richardQuinBuddyMessageProcessURL\n+\n+    def 'Add user Richard Quin'(){\n+        given:\n+\n+        when:\n+        def response = appService.addUser(\"\"\"{\n+\t\t\t\t\"firstName\":\"Richard ${timestamp}\",\n+\t\t\t\t\"lastName\":\"Quin ${timestamp}\",\n+\t\t\t\t\"nickName\":\"RQ ${timestamp}\",\n+\t\t\t\t\"emailAddress\":\"rich${timestamp}@quin.net\",\n+\t\t\t\t\"mobileNumber\":\"+${timestamp}1\",\n+\t\t\t\t\"devices\":[\n+\t\t\t\t\t\"Nexus 6\"\n+\t\t\t\t],\n+\t\t\t\t\"goals\":[\n+\t\t\t\t\t\"news\"\n+\t\t\t\t]\n+\t\t\t}\"\"\", richardQuinPassword)\n+        richardQuinURL = appService.stripQueryString(response.responseData._links.self.href)\n+        richardQuinLoginID = response.responseData.vpnProfile.loginID;\n+\n+        then:\n+        response.status == 201\n+        richardQuinURL.startsWith(appServiceBaseURL + appService.USERS_PATH)\n+\n+        cleanup:\n+        println \"URL Richard: \" + richardQuinURL\n+    }\n+\n+    def 'Add user Bob Dunn'(){\n+        given:\n+\n+        when:\n+        def response = appService.addUser(\"\"\"{\n+\t\t\t\t\"firstName\":\"Bob ${timestamp}\",\n+\t\t\t\t\"lastName\":\"Dunn ${timestamp}\",\n+\t\t\t\t\"nickName\":\"BD ${timestamp}\",\n+\t\t\t\t\"emailAddress\":\"bob${timestamp}@dunn.net\",\n+\t\t\t\t\"mobileNumber\":\"+${timestamp}2\",\n+\t\t\t\t\"devices\":[\n+\t\t\t\t\t\"iPhone 6\"\n+\t\t\t\t],\n+\t\t\t\t\"goals\":[\n+\t\t\t\t\t\"gambling\"\n+\t\t\t\t]\n+\t\t\t}\"\"\", bobDunnPassword)\n+        bobDunnURL = appService.stripQueryString(response.responseData._links.self.href)\n+        bobDunnLoginID = response.responseData.vpnProfile.loginID;\n+\n+        then:\n+        response.status == 201\n+        bobDunnURL.startsWith(appServiceBaseURL + appService.USERS_PATH)\n+\n+        cleanup:\n+        println \"URL Bob: \" + bobDunnURL\n+    }\n+\n+    def 'Richard requests Bob to become his buddy'(){\n+        given:\n+\n+        when:\n+        def response = appService.requestBuddy(richardQuinURL, \"\"\"{\n+\t\t\t\t\"_embedded\":{\n+\t\t\t\t\t\"user\":{\n+\t\t\t\t\t\t\"firstName\":\"Bob ${timestamp}\",\n+\t\t\t\t\t\t\"lastName\":\"Dun ${timestamp}n\",\n+\t\t\t\t\t\t\"emailAddress\":\"bob${timestamp}@dunn.net\",\n+\t\t\t\t\t\t\"mobileNumber\":\"+ ${timestamp}2\"\n+\t\t\t\t\t}\n+\t\t\t\t},\n+\t\t\t\t\"message\":\"Would you like to be my buddy?\"\n+\t\t\t}\"\"\", richardQuinPassword)\n+        richardQuinBobBuddyURL = response.responseData._links.self.href","path":"appservice/src/intTest/groovy/nu/yona/server/RejectBuddyTest.groovy","position":109,"original_position":109,"commit_id":"10c2bad6ed16fbaa5d7b57713c9ca41b7db5238d","original_commit_id":"3faaee48e582ef1addbddda8c859accb008e6553","user":{"login":"Bert-R","id":7149792,"avatar_url":"https://avatars.githubusercontent.com/u/7149792?v=3","gravatar_id":"","url":"https://api.github.com/users/Bert-R","html_url":"https://github.com/Bert-R","followers_url":"https://api.github.com/users/Bert-R/followers","following_url":"https://api.github.com/users/Bert-R/following{/other_user}","gists_url":"https://api.github.com/users/Bert-R/gists{/gist_id}","starred_url":"https://api.github.com/users/Bert-R/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bert-R/subscriptions","organizations_url":"https://api.github.com/users/Bert-R/orgs","repos_url":"https://api.github.com/users/Bert-R/repos","events_url":"https://api.github.com/users/Bert-R/events{/privacy}","received_events_url":"https://api.github.com/users/Bert-R/received_events","type":"User","site_admin":false},"body":"Only do this when the status is 201, to prevent unreadable error messages.","created_at":"2015-11-23T07:43:43Z","updated_at":"2015-11-23T07:43:43Z","html_url":"https://github.com/yonadev/yona-server/pull/15#discussion_r45577423","pull_request_url":"https://api.github.com/repos/yonadev/yona-server/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/comments/45577423"},"html":{"href":"https://github.com/yonadev/yona-server/pull/15#discussion_r45577423"},"pull_request":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/yonadev/yona-server/pulls/15","id":51195647,"html_url":"https://github.com/yonadev/yona-server/pull/15","diff_url":"https://github.com/yonadev/yona-server/pull/15.diff","patch_url":"https://github.com/yonadev/yona-server/pull/15.patch","issue_url":"https://api.github.com/repos/yonadev/yona-server/issues/15","number":15,"state":"open","locked":false,"title":"YD-60 Implement decline buddy request","user":{"login":"2gmpoyhonen","id":15871829,"avatar_url":"https://avatars.githubusercontent.com/u/15871829?v=3","gravatar_id":"","url":"https://api.github.com/users/2gmpoyhonen","html_url":"https://github.com/2gmpoyhonen","followers_url":"https://api.github.com/users/2gmpoyhonen/followers","following_url":"https://api.github.com/users/2gmpoyhonen/following{/other_user}","gists_url":"https://api.github.com/users/2gmpoyhonen/gists{/gist_id}","starred_url":"https://api.github.com/users/2gmpoyhonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gmpoyhonen/subscriptions","organizations_url":"https://api.github.com/users/2gmpoyhonen/orgs","repos_url":"https://api.github.com/users/2gmpoyhonen/repos","events_url":"https://api.github.com/users/2gmpoyhonen/events{/privacy}","received_events_url":"https://api.github.com/users/2gmpoyhonen/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-19T08:59:56Z","updated_at":"2015-11-23T07:43:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7762f95794381bb40953fe00c2710688a06e84f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yonadev/yona-server/pulls/15/commits","review_comments_url":"https://api.github.com/repos/yonadev/yona-server/pulls/15/comments","review_comment_url":"https://api.github.com/repos/yonadev/yona-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yonadev/yona-server/issues/15/comments","statuses_url":"https://api.github.com/repos/yonadev/yona-server/statuses/10c2bad6ed16fbaa5d7b57713c9ca41b7db5238d","head":{"label":"yonadev:yd-60-implement-decline-buddy-request","ref":"yd-60-implement-decline-buddy-request","sha":"10c2bad6ed16fbaa5d7b57713c9ca41b7db5238d","user":{"login":"yonadev","id":14901571,"avatar_url":"https://avatars.githubusercontent.com/u/14901571?v=3","gravatar_id":"","url":"https://api.github.com/users/yonadev","html_url":"https://github.com/yonadev","followers_url":"https://api.github.com/users/yonadev/followers","following_url":"https://api.github.com/users/yonadev/following{/other_user}","gists_url":"https://api.github.com/users/yonadev/gists{/gist_id}","starred_url":"https://api.github.com/users/yonadev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonadev/subscriptions","organizations_url":"https://api.github.com/users/yonadev/orgs","repos_url":"https://api.github.com/users/yonadev/repos","events_url":"https://api.github.com/users/yonadev/events{/privacy}","received_events_url":"https://api.github.com/users/yonadev/received_events","type":"Organization","site_admin":false},"repo":{"id":43589108,"name":"yona-server","full_name":"yonadev/yona-server","owner":{"login":"yonadev","id":14901571,"avatar_url":"https://avatars.githubusercontent.com/u/14901571?v=3","gravatar_id":"","url":"https://api.github.com/users/yonadev","html_url":"https://github.com/yonadev","followers_url":"https://api.github.com/users/yonadev/followers","following_url":"https://api.github.com/users/yonadev/following{/other_user}","gists_url":"https://api.github.com/users/yonadev/gists{/gist_id}","starred_url":"https://api.github.com/users/yonadev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonadev/subscriptions","organizations_url":"https://api.github.com/users/yonadev/orgs","repos_url":"https://api.github.com/users/yonadev/repos","events_url":"https://api.github.com/users/yonadev/events{/privacy}","received_events_url":"https://api.github.com/users/yonadev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yonadev/yona-server","description":"Yona Server","fork":false,"url":"https://api.github.com/repos/yonadev/yona-server","forks_url":"https://api.github.com/repos/yonadev/yona-server/forks","keys_url":"https://api.github.com/repos/yonadev/yona-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yonadev/yona-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yonadev/yona-server/teams","hooks_url":"https://api.github.com/repos/yonadev/yona-server/hooks","issue_events_url":"https://api.github.com/repos/yonadev/yona-server/issues/events{/number}","events_url":"https://api.github.com/repos/yonadev/yona-server/events","assignees_url":"https://api.github.com/repos/yonadev/yona-server/assignees{/user}","branches_url":"https://api.github.com/repos/yonadev/yona-server/branches{/branch}","tags_url":"https://api.github.com/repos/yonadev/yona-server/tags","blobs_url":"https://api.github.com/repos/yonadev/yona-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yonadev/yona-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yonadev/yona-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/yonadev/yona-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yonadev/yona-server/statuses/{sha}","languages_url":"https://api.github.com/repos/yonadev/yona-server/languages","stargazers_url":"https://api.github.com/repos/yonadev/yona-server/stargazers","contributors_url":"https://api.github.com/repos/yonadev/yona-server/contributors","subscribers_url":"https://api.github.com/repos/yonadev/yona-server/subscribers","subscription_url":"https://api.github.com/repos/yonadev/yona-server/subscription","commits_url":"https://api.github.com/repos/yonadev/yona-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/yonadev/yona-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/yonadev/yona-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/yonadev/yona-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/yonadev/yona-server/contents/{+path}","compare_url":"https://api.github.com/repos/yonadev/yona-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yonadev/yona-server/merges","archive_url":"https://api.github.com/repos/yonadev/yona-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yonadev/yona-server/downloads","issues_url":"https://api.github.com/repos/yonadev/yona-server/issues{/number}","pulls_url":"https://api.github.com/repos/yonadev/yona-server/pulls{/number}","milestones_url":"https://api.github.com/repos/yonadev/yona-server/milestones{/number}","notifications_url":"https://api.github.com/repos/yonadev/yona-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yonadev/yona-server/labels{/name}","releases_url":"https://api.github.com/repos/yonadev/yona-server/releases{/id}","created_at":"2015-10-03T05:33:54Z","updated_at":"2015-11-16T11:29:28Z","pushed_at":"2015-11-23T07:39:27Z","git_url":"git://github.com/yonadev/yona-server.git","ssh_url":"git@github.com:yonadev/yona-server.git","clone_url":"https://github.com/yonadev/yona-server.git","svn_url":"https://github.com/yonadev/yona-server","homepage":null,"size":534,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"yonadev:master","ref":"master","sha":"efe0ce1fadc15c57955dff9af1a1a63cab6c8e44","user":{"login":"yonadev","id":14901571,"avatar_url":"https://avatars.githubusercontent.com/u/14901571?v=3","gravatar_id":"","url":"https://api.github.com/users/yonadev","html_url":"https://github.com/yonadev","followers_url":"https://api.github.com/users/yonadev/followers","following_url":"https://api.github.com/users/yonadev/following{/other_user}","gists_url":"https://api.github.com/users/yonadev/gists{/gist_id}","starred_url":"https://api.github.com/users/yonadev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonadev/subscriptions","organizations_url":"https://api.github.com/users/yonadev/orgs","repos_url":"https://api.github.com/users/yonadev/repos","events_url":"https://api.github.com/users/yonadev/events{/privacy}","received_events_url":"https://api.github.com/users/yonadev/received_events","type":"Organization","site_admin":false},"repo":{"id":43589108,"name":"yona-server","full_name":"yonadev/yona-server","owner":{"login":"yonadev","id":14901571,"avatar_url":"https://avatars.githubusercontent.com/u/14901571?v=3","gravatar_id":"","url":"https://api.github.com/users/yonadev","html_url":"https://github.com/yonadev","followers_url":"https://api.github.com/users/yonadev/followers","following_url":"https://api.github.com/users/yonadev/following{/other_user}","gists_url":"https://api.github.com/users/yonadev/gists{/gist_id}","starred_url":"https://api.github.com/users/yonadev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonadev/subscriptions","organizations_url":"https://api.github.com/users/yonadev/orgs","repos_url":"https://api.github.com/users/yonadev/repos","events_url":"https://api.github.com/users/yonadev/events{/privacy}","received_events_url":"https://api.github.com/users/yonadev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yonadev/yona-server","description":"Yona Server","fork":false,"url":"https://api.github.com/repos/yonadev/yona-server","forks_url":"https://api.github.com/repos/yonadev/yona-server/forks","keys_url":"https://api.github.com/repos/yonadev/yona-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yonadev/yona-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yonadev/yona-server/teams","hooks_url":"https://api.github.com/repos/yonadev/yona-server/hooks","issue_events_url":"https://api.github.com/repos/yonadev/yona-server/issues/events{/number}","events_url":"https://api.github.com/repos/yonadev/yona-server/events","assignees_url":"https://api.github.com/repos/yonadev/yona-server/assignees{/user}","branches_url":"https://api.github.com/repos/yonadev/yona-server/branches{/branch}","tags_url":"https://api.github.com/repos/yonadev/yona-server/tags","blobs_url":"https://api.github.com/repos/yonadev/yona-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yonadev/yona-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yonadev/yona-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/yonadev/yona-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yonadev/yona-server/statuses/{sha}","languages_url":"https://api.github.com/repos/yonadev/yona-server/languages","stargazers_url":"https://api.github.com/repos/yonadev/yona-server/stargazers","contributors_url":"https://api.github.com/repos/yonadev/yona-server/contributors","subscribers_url":"https://api.github.com/repos/yonadev/yona-server/subscribers","subscription_url":"https://api.github.com/repos/yonadev/yona-server/subscription","commits_url":"https://api.github.com/repos/yonadev/yona-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/yonadev/yona-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/yonadev/yona-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/yonadev/yona-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/yonadev/yona-server/contents/{+path}","compare_url":"https://api.github.com/repos/yonadev/yona-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yonadev/yona-server/merges","archive_url":"https://api.github.com/repos/yonadev/yona-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yonadev/yona-server/downloads","issues_url":"https://api.github.com/repos/yonadev/yona-server/issues{/number}","pulls_url":"https://api.github.com/repos/yonadev/yona-server/pulls{/number}","milestones_url":"https://api.github.com/repos/yonadev/yona-server/milestones{/number}","notifications_url":"https://api.github.com/repos/yonadev/yona-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yonadev/yona-server/labels{/name}","releases_url":"https://api.github.com/repos/yonadev/yona-server/releases{/id}","created_at":"2015-10-03T05:33:54Z","updated_at":"2015-11-16T11:29:28Z","pushed_at":"2015-11-23T07:39:27Z","git_url":"git://github.com/yonadev/yona-server.git","ssh_url":"git@github.com:yonadev/yona-server.git","clone_url":"https://github.com/yonadev/yona-server.git","svn_url":"https://github.com/yonadev/yona-server","homepage":null,"size":534,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/15"},"html":{"href":"https://github.com/yonadev/yona-server/pull/15"},"issue":{"href":"https://api.github.com/repos/yonadev/yona-server/issues/15"},"comments":{"href":"https://api.github.com/repos/yonadev/yona-server/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yonadev/yona-server/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/yonadev/yona-server/statuses/10c2bad6ed16fbaa5d7b57713c9ca41b7db5238d"}}}}