{"action":"created","comment":{"url":"https://api.github.com/repos/Cognifide/Slice/pulls/comments/29340858","id":29340858,"diff_hunk":"@@ -0,0 +1,121 @@\n+/*-\n+ * #%L\n+ * Slice - Mapper Tests\n+ * %%\n+ * Copyright (C) 2012 Cognifide Limited\n+ * %%\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ * #L%\n+ */\n+package com.cognifide.slice.mapper.annotation\n+\n+import com.cognifide.slice.test.setup.BaseSetup\n+import com.google.inject.ProvisionException\n+import org.junit.Assert\n+import spock.lang.FailsWith\n+\n+/**\n+ * @author Mariusz Kubiś\n+ * Date: 10.04.15\n+ */\n+class FollowTest extends BaseSetup {\n+\n+\tdef \"Follow test\"() {\n+\t\tsetup:\n+\t\tString jcrPropertyModelPath = \"/content/foo/jcr:content\";\n+\n+\t\tpageBuilder.content {\n+\t\t\tfoo(\"cq:PageContent\") {\n+\t\t\t\t\"jcr:content\"(\"text\": \"Test\", \"style\": \"Style\", \"size\": 5)\n+\t\t\t}\n+\t\t}\n+\t\tpageBuilder.content {\n+\t\t\tbar(\"cq:PageContent\") { \"jcr:content\"(\"jcrPropertyModel\": jcrPropertyModelPath) }\n+\t\t}\n+\n+\t\texpect:\n+\t\tassertPageExists(\"/content/foo\")\n+\t\tJcrPropertyModel jcrPropertyModel = modelProvider.get(JcrPropertyModel.class, jcrPropertyModelPath)\n+\t\tcheckJcrPropertyModel(jcrPropertyModel)\n+\n+\t\tassertPageExists(\"/content/bar\")\n+\t\tFollowModel followModel = modelProvider.get(FollowModel.class, \"/content/bar/jcr:content\")\n+\t\tAssert.assertEquals(followModel.getJcrPropertyModelPath(), jcrPropertyModelPath)\n+\t\tcheckJcrPropertyModel(followModel.getJcrPropertyModel())\n+\t}\n+\n+\tdef \"Follow test with null value\"() {\n+\t\tsetup: \"Create a test content, under path '/content/bar', with property 'jcrPropertyModel' set to null\"\n+\t\tpageBuilder.content {\n+\t\t\tbar(\"cq:PageContent\") { \"jcr:content\"(\"jcrPropertyModel\": null) }\n+\t\t}\n+\t\twhen: \"Getting Follow model, based on null path\"\n+\t\tmodelProvider.get(FollowModel.class, \"/content/bar/jcr:content\")\n+\n+\t\tthen: \"ProvisionException should be thrown - resource can not be null\"\n+\t\tthrown(ProvisionException)","path":"slice-test/slice-mapper-test/src/test/groovy/com/cognifide/slice/mapper/annotation/FollowTest.groovy","position":66,"original_position":66,"commit_id":"e6c8c291330f72ab99d5136ab03523b647b85f79","original_commit_id":"e6c8c291330f72ab99d5136ab03523b647b85f79","user":{"login":"mmajchrzak","id":942248,"avatar_url":"https://avatars.githubusercontent.com/u/942248?v=3","gravatar_id":"","url":"https://api.github.com/users/mmajchrzak","html_url":"https://github.com/mmajchrzak","followers_url":"https://api.github.com/users/mmajchrzak/followers","following_url":"https://api.github.com/users/mmajchrzak/following{/other_user}","gists_url":"https://api.github.com/users/mmajchrzak/gists{/gist_id}","starred_url":"https://api.github.com/users/mmajchrzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmajchrzak/subscriptions","organizations_url":"https://api.github.com/users/mmajchrzak/orgs","repos_url":"https://api.github.com/users/mmajchrzak/repos","events_url":"https://api.github.com/users/mmajchrzak/events{/privacy}","received_events_url":"https://api.github.com/users/mmajchrzak/received_events","type":"User","site_admin":false},"body":"Boom! You don't expect Slice to throw an exception here. Because it does, then we've found a bug ;)","created_at":"2015-04-29T14:30:36Z","updated_at":"2015-04-29T14:30:36Z","html_url":"https://github.com/Cognifide/Slice/pull/81#discussion_r29340858","pull_request_url":"https://api.github.com/repos/Cognifide/Slice/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/comments/29340858"},"html":{"href":"https://github.com/Cognifide/Slice/pull/81#discussion_r29340858"},"pull_request":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/Cognifide/Slice/pulls/81","id":33653758,"html_url":"https://github.com/Cognifide/Slice/pull/81","diff_url":"https://github.com/Cognifide/Slice/pull/81.diff","patch_url":"https://github.com/Cognifide/Slice/pull/81.patch","issue_url":"https://api.github.com/repos/Cognifide/Slice/issues/81","number":81,"state":"open","locked":false,"title":"Slice api tests","user":{"login":"mariuszkubis","id":11609698,"avatar_url":"https://avatars.githubusercontent.com/u/11609698?v=3","gravatar_id":"","url":"https://api.github.com/users/mariuszkubis","html_url":"https://github.com/mariuszkubis","followers_url":"https://api.github.com/users/mariuszkubis/followers","following_url":"https://api.github.com/users/mariuszkubis/following{/other_user}","gists_url":"https://api.github.com/users/mariuszkubis/gists{/gist_id}","starred_url":"https://api.github.com/users/mariuszkubis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariuszkubis/subscriptions","organizations_url":"https://api.github.com/users/mariuszkubis/orgs","repos_url":"https://api.github.com/users/mariuszkubis/repos","events_url":"https://api.github.com/users/mariuszkubis/events{/privacy}","received_events_url":"https://api.github.com/users/mariuszkubis/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-20T10:43:28Z","updated_at":"2015-04-29T14:30:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fd542f36fd373367f52ea95fe76ed4f940fecad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Cognifide/Slice/pulls/81/commits","review_comments_url":"https://api.github.com/repos/Cognifide/Slice/pulls/81/comments","review_comment_url":"https://api.github.com/repos/Cognifide/Slice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cognifide/Slice/issues/81/comments","statuses_url":"https://api.github.com/repos/Cognifide/Slice/statuses/e6c8c291330f72ab99d5136ab03523b647b85f79","head":{"label":"Cognifide:SLICE-API_TESTS","ref":"SLICE-API_TESTS","sha":"e6c8c291330f72ab99d5136ab03523b647b85f79","user":{"login":"Cognifide","id":932257,"avatar_url":"https://avatars.githubusercontent.com/u/932257?v=3","gravatar_id":"","url":"https://api.github.com/users/Cognifide","html_url":"https://github.com/Cognifide","followers_url":"https://api.github.com/users/Cognifide/followers","following_url":"https://api.github.com/users/Cognifide/following{/other_user}","gists_url":"https://api.github.com/users/Cognifide/gists{/gist_id}","starred_url":"https://api.github.com/users/Cognifide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cognifide/subscriptions","organizations_url":"https://api.github.com/users/Cognifide/orgs","repos_url":"https://api.github.com/users/Cognifide/repos","events_url":"https://api.github.com/users/Cognifide/events{/privacy}","received_events_url":"https://api.github.com/users/Cognifide/received_events","type":"Organization","site_admin":false},"repo":{"id":5900702,"name":"Slice","full_name":"Cognifide/Slice","owner":{"login":"Cognifide","id":932257,"avatar_url":"https://avatars.githubusercontent.com/u/932257?v=3","gravatar_id":"","url":"https://api.github.com/users/Cognifide","html_url":"https://github.com/Cognifide","followers_url":"https://api.github.com/users/Cognifide/followers","following_url":"https://api.github.com/users/Cognifide/following{/other_user}","gists_url":"https://api.github.com/users/Cognifide/gists{/gist_id}","starred_url":"https://api.github.com/users/Cognifide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cognifide/subscriptions","organizations_url":"https://api.github.com/users/Cognifide/orgs","repos_url":"https://api.github.com/users/Cognifide/repos","events_url":"https://api.github.com/users/Cognifide/events{/privacy}","received_events_url":"https://api.github.com/users/Cognifide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cognifide/Slice","description":"Slice","fork":false,"url":"https://api.github.com/repos/Cognifide/Slice","forks_url":"https://api.github.com/repos/Cognifide/Slice/forks","keys_url":"https://api.github.com/repos/Cognifide/Slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cognifide/Slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cognifide/Slice/teams","hooks_url":"https://api.github.com/repos/Cognifide/Slice/hooks","issue_events_url":"https://api.github.com/repos/Cognifide/Slice/issues/events{/number}","events_url":"https://api.github.com/repos/Cognifide/Slice/events","assignees_url":"https://api.github.com/repos/Cognifide/Slice/assignees{/user}","branches_url":"https://api.github.com/repos/Cognifide/Slice/branches{/branch}","tags_url":"https://api.github.com/repos/Cognifide/Slice/tags","blobs_url":"https://api.github.com/repos/Cognifide/Slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cognifide/Slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cognifide/Slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cognifide/Slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cognifide/Slice/statuses/{sha}","languages_url":"https://api.github.com/repos/Cognifide/Slice/languages","stargazers_url":"https://api.github.com/repos/Cognifide/Slice/stargazers","contributors_url":"https://api.github.com/repos/Cognifide/Slice/contributors","subscribers_url":"https://api.github.com/repos/Cognifide/Slice/subscribers","subscription_url":"https://api.github.com/repos/Cognifide/Slice/subscription","commits_url":"https://api.github.com/repos/Cognifide/Slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cognifide/Slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cognifide/Slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cognifide/Slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cognifide/Slice/contents/{+path}","compare_url":"https://api.github.com/repos/Cognifide/Slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cognifide/Slice/merges","archive_url":"https://api.github.com/repos/Cognifide/Slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cognifide/Slice/downloads","issues_url":"https://api.github.com/repos/Cognifide/Slice/issues{/number}","pulls_url":"https://api.github.com/repos/Cognifide/Slice/pulls{/number}","milestones_url":"https://api.github.com/repos/Cognifide/Slice/milestones{/number}","notifications_url":"https://api.github.com/repos/Cognifide/Slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cognifide/Slice/labels{/name}","releases_url":"https://api.github.com/repos/Cognifide/Slice/releases{/id}","created_at":"2012-09-21T11:52:26Z","updated_at":"2015-04-21T12:07:23Z","pushed_at":"2015-04-29T14:14:59Z","git_url":"git://github.com/Cognifide/Slice.git","ssh_url":"git@github.com:Cognifide/Slice.git","clone_url":"https://github.com/Cognifide/Slice.git","svn_url":"https://github.com/Cognifide/Slice","homepage":"","size":4844,"stargazers_count":38,"watchers_count":38,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":38,"default_branch":"master"}},"base":{"label":"Cognifide:master","ref":"master","sha":"770f60c260b8147d7c677620f046a098c6a36a96","user":{"login":"Cognifide","id":932257,"avatar_url":"https://avatars.githubusercontent.com/u/932257?v=3","gravatar_id":"","url":"https://api.github.com/users/Cognifide","html_url":"https://github.com/Cognifide","followers_url":"https://api.github.com/users/Cognifide/followers","following_url":"https://api.github.com/users/Cognifide/following{/other_user}","gists_url":"https://api.github.com/users/Cognifide/gists{/gist_id}","starred_url":"https://api.github.com/users/Cognifide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cognifide/subscriptions","organizations_url":"https://api.github.com/users/Cognifide/orgs","repos_url":"https://api.github.com/users/Cognifide/repos","events_url":"https://api.github.com/users/Cognifide/events{/privacy}","received_events_url":"https://api.github.com/users/Cognifide/received_events","type":"Organization","site_admin":false},"repo":{"id":5900702,"name":"Slice","full_name":"Cognifide/Slice","owner":{"login":"Cognifide","id":932257,"avatar_url":"https://avatars.githubusercontent.com/u/932257?v=3","gravatar_id":"","url":"https://api.github.com/users/Cognifide","html_url":"https://github.com/Cognifide","followers_url":"https://api.github.com/users/Cognifide/followers","following_url":"https://api.github.com/users/Cognifide/following{/other_user}","gists_url":"https://api.github.com/users/Cognifide/gists{/gist_id}","starred_url":"https://api.github.com/users/Cognifide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cognifide/subscriptions","organizations_url":"https://api.github.com/users/Cognifide/orgs","repos_url":"https://api.github.com/users/Cognifide/repos","events_url":"https://api.github.com/users/Cognifide/events{/privacy}","received_events_url":"https://api.github.com/users/Cognifide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cognifide/Slice","description":"Slice","fork":false,"url":"https://api.github.com/repos/Cognifide/Slice","forks_url":"https://api.github.com/repos/Cognifide/Slice/forks","keys_url":"https://api.github.com/repos/Cognifide/Slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cognifide/Slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cognifide/Slice/teams","hooks_url":"https://api.github.com/repos/Cognifide/Slice/hooks","issue_events_url":"https://api.github.com/repos/Cognifide/Slice/issues/events{/number}","events_url":"https://api.github.com/repos/Cognifide/Slice/events","assignees_url":"https://api.github.com/repos/Cognifide/Slice/assignees{/user}","branches_url":"https://api.github.com/repos/Cognifide/Slice/branches{/branch}","tags_url":"https://api.github.com/repos/Cognifide/Slice/tags","blobs_url":"https://api.github.com/repos/Cognifide/Slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cognifide/Slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cognifide/Slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cognifide/Slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cognifide/Slice/statuses/{sha}","languages_url":"https://api.github.com/repos/Cognifide/Slice/languages","stargazers_url":"https://api.github.com/repos/Cognifide/Slice/stargazers","contributors_url":"https://api.github.com/repos/Cognifide/Slice/contributors","subscribers_url":"https://api.github.com/repos/Cognifide/Slice/subscribers","subscription_url":"https://api.github.com/repos/Cognifide/Slice/subscription","commits_url":"https://api.github.com/repos/Cognifide/Slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cognifide/Slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cognifide/Slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cognifide/Slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cognifide/Slice/contents/{+path}","compare_url":"https://api.github.com/repos/Cognifide/Slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cognifide/Slice/merges","archive_url":"https://api.github.com/repos/Cognifide/Slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cognifide/Slice/downloads","issues_url":"https://api.github.com/repos/Cognifide/Slice/issues{/number}","pulls_url":"https://api.github.com/repos/Cognifide/Slice/pulls{/number}","milestones_url":"https://api.github.com/repos/Cognifide/Slice/milestones{/number}","notifications_url":"https://api.github.com/repos/Cognifide/Slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cognifide/Slice/labels{/name}","releases_url":"https://api.github.com/repos/Cognifide/Slice/releases{/id}","created_at":"2012-09-21T11:52:26Z","updated_at":"2015-04-21T12:07:23Z","pushed_at":"2015-04-29T14:14:59Z","git_url":"git://github.com/Cognifide/Slice.git","ssh_url":"git@github.com:Cognifide/Slice.git","clone_url":"https://github.com/Cognifide/Slice.git","svn_url":"https://github.com/Cognifide/Slice","homepage":"","size":4844,"stargazers_count":38,"watchers_count":38,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/81"},"html":{"href":"https://github.com/Cognifide/Slice/pull/81"},"issue":{"href":"https://api.github.com/repos/Cognifide/Slice/issues/81"},"comments":{"href":"https://api.github.com/repos/Cognifide/Slice/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cognifide/Slice/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/Cognifide/Slice/statuses/e6c8c291330f72ab99d5136ab03523b647b85f79"}}}}