{"action":"opened","number":21,"pull_request":{"url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21","id":219543507,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5NTQzNTA3","html_url":"https://github.com/infusionvlc/somnium_server/pull/21","diff_url":"https://github.com/infusionvlc/somnium_server/pull/21.diff","patch_url":"https://github.com/infusionvlc/somnium_server/pull/21.patch","issue_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/21","number":21,"state":"open","locked":false,"title":"Search dream","user":{"login":"tonilopezmr","id":5845622,"node_id":"MDQ6VXNlcjU4NDU2MjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5845622?v=4","gravatar_id":"","url":"https://api.github.com/users/tonilopezmr","html_url":"https://github.com/tonilopezmr","followers_url":"https://api.github.com/users/tonilopezmr/followers","following_url":"https://api.github.com/users/tonilopezmr/following{/other_user}","gists_url":"https://api.github.com/users/tonilopezmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonilopezmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonilopezmr/subscriptions","organizations_url":"https://api.github.com/users/tonilopezmr/orgs","repos_url":"https://api.github.com/users/tonilopezmr/repos","events_url":"https://api.github.com/users/tonilopezmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonilopezmr/received_events","type":"User","site_admin":false},"body":"### :pushpin: References\r\n* **Issue:** #15 \r\n\r\n### :tophat: What is the goal?\r\n\r\n* Add search dreams endpoint by containing a title with case insensitive.\r\n* Add an integration test.\r\n\r\n### :memo: How is it being implemented?\r\n\r\n* Add a new use case `SearchDream` by title at the moment, it is paginated.\r\n* Add a method in the `DreamRepository` to make a query finding by containing the title, it should be case insensitive.\r\n* Create the endpoint `/search` in `DreamController` which operates over `/dreams/v1` path, then the new full endpoint is `GET /dreams/v1/search`, there are three query params:\r\n\r\n    1. `title` : Title of the dream to search\r\n    2. `page` : Number of the page with zero-based page index.\r\n    3. `page_size` : Dreams found size by page.\r\n\r\n* Create an integration test to know the search is going to go as expected, I wanted to do a full integration test including the REST part but I wasn't able to run it with `TestRestTemplate` in a short time because I need to authenticate the request or just mock the authentication, but I know yet how to mock the authentication to make an HTTP call with a default user or bypass token. \r\n\r\n*@Cotel or @everyone here want to improve the test using HTTP calls instead of the `DreamController` you can commit in my PR, it is a beautiful exercise.*\r\n \r\n### :boom: How can it be tested?\r\n\r\n- [x] **Search a Dream:**\r\n  - [x] Must be dreams in the system.\r\n  - [x] `GET /dreams/v1/search?title=Dream&page=0&page_size=20`\r\n  - [x] You will see the dreams containing `Dream` in the title\r\n \r\n","created_at":"2018-10-01T23:16:29Z","updated_at":"2018-10-01T23:16:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21/commits","review_comments_url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21/comments","review_comment_url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/21/comments","statuses_url":"https://api.github.com/repos/infusionvlc/somnium_server/statuses/ccc4fbbf45a9d8e372f64b610f0486fc80df93cf","head":{"label":"infusionvlc:search-dream","ref":"search-dream","sha":"ccc4fbbf45a9d8e372f64b610f0486fc80df93cf","user":{"login":"infusionvlc","id":34789689,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Nzg5Njg5","avatar_url":"https://avatars2.githubusercontent.com/u/34789689?v=4","gravatar_id":"","url":"https://api.github.com/users/infusionvlc","html_url":"https://github.com/infusionvlc","followers_url":"https://api.github.com/users/infusionvlc/followers","following_url":"https://api.github.com/users/infusionvlc/following{/other_user}","gists_url":"https://api.github.com/users/infusionvlc/gists{/gist_id}","starred_url":"https://api.github.com/users/infusionvlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infusionvlc/subscriptions","organizations_url":"https://api.github.com/users/infusionvlc/orgs","repos_url":"https://api.github.com/users/infusionvlc/repos","events_url":"https://api.github.com/users/infusionvlc/events{/privacy}","received_events_url":"https://api.github.com/users/infusionvlc/received_events","type":"Organization","site_admin":false},"repo":{"id":150881554,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA4ODE1NTQ=","name":"somnium_server","full_name":"infusionvlc/somnium_server","private":false,"owner":{"login":"infusionvlc","id":34789689,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Nzg5Njg5","avatar_url":"https://avatars2.githubusercontent.com/u/34789689?v=4","gravatar_id":"","url":"https://api.github.com/users/infusionvlc","html_url":"https://github.com/infusionvlc","followers_url":"https://api.github.com/users/infusionvlc/followers","following_url":"https://api.github.com/users/infusionvlc/following{/other_user}","gists_url":"https://api.github.com/users/infusionvlc/gists{/gist_id}","starred_url":"https://api.github.com/users/infusionvlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infusionvlc/subscriptions","organizations_url":"https://api.github.com/users/infusionvlc/orgs","repos_url":"https://api.github.com/users/infusionvlc/repos","events_url":"https://api.github.com/users/infusionvlc/events{/privacy}","received_events_url":"https://api.github.com/users/infusionvlc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/infusionvlc/somnium_server","description":"A social dream dictionary and journal :purple_heart: :zzz:","fork":false,"url":"https://api.github.com/repos/infusionvlc/somnium_server","forks_url":"https://api.github.com/repos/infusionvlc/somnium_server/forks","keys_url":"https://api.github.com/repos/infusionvlc/somnium_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infusionvlc/somnium_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infusionvlc/somnium_server/teams","hooks_url":"https://api.github.com/repos/infusionvlc/somnium_server/hooks","issue_events_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/events{/number}","events_url":"https://api.github.com/repos/infusionvlc/somnium_server/events","assignees_url":"https://api.github.com/repos/infusionvlc/somnium_server/assignees{/user}","branches_url":"https://api.github.com/repos/infusionvlc/somnium_server/branches{/branch}","tags_url":"https://api.github.com/repos/infusionvlc/somnium_server/tags","blobs_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infusionvlc/somnium_server/statuses/{sha}","languages_url":"https://api.github.com/repos/infusionvlc/somnium_server/languages","stargazers_url":"https://api.github.com/repos/infusionvlc/somnium_server/stargazers","contributors_url":"https://api.github.com/repos/infusionvlc/somnium_server/contributors","subscribers_url":"https://api.github.com/repos/infusionvlc/somnium_server/subscribers","subscription_url":"https://api.github.com/repos/infusionvlc/somnium_server/subscription","commits_url":"https://api.github.com/repos/infusionvlc/somnium_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/infusionvlc/somnium_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/infusionvlc/somnium_server/contents/{+path}","compare_url":"https://api.github.com/repos/infusionvlc/somnium_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infusionvlc/somnium_server/merges","archive_url":"https://api.github.com/repos/infusionvlc/somnium_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infusionvlc/somnium_server/downloads","issues_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues{/number}","pulls_url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls{/number}","milestones_url":"https://api.github.com/repos/infusionvlc/somnium_server/milestones{/number}","notifications_url":"https://api.github.com/repos/infusionvlc/somnium_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infusionvlc/somnium_server/labels{/name}","releases_url":"https://api.github.com/repos/infusionvlc/somnium_server/releases{/id}","deployments_url":"https://api.github.com/repos/infusionvlc/somnium_server/deployments","created_at":"2018-09-29T16:14:21Z","updated_at":"2018-09-30T17:55:13Z","pushed_at":"2018-10-01T22:54:49Z","git_url":"git://github.com/infusionvlc/somnium_server.git","ssh_url":"git@github.com:infusionvlc/somnium_server.git","clone_url":"https://github.com/infusionvlc/somnium_server.git","svn_url":"https://github.com/infusionvlc/somnium_server","homepage":"http://somnium.io","size":98,"stargazers_count":2,"watchers_count":2,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":1,"open_issues":19,"watchers":2,"default_branch":"master"}},"base":{"label":"infusionvlc:develop","ref":"develop","sha":"7c2bb488169319a888087fa871b4144071b779b9","user":{"login":"infusionvlc","id":34789689,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Nzg5Njg5","avatar_url":"https://avatars2.githubusercontent.com/u/34789689?v=4","gravatar_id":"","url":"https://api.github.com/users/infusionvlc","html_url":"https://github.com/infusionvlc","followers_url":"https://api.github.com/users/infusionvlc/followers","following_url":"https://api.github.com/users/infusionvlc/following{/other_user}","gists_url":"https://api.github.com/users/infusionvlc/gists{/gist_id}","starred_url":"https://api.github.com/users/infusionvlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infusionvlc/subscriptions","organizations_url":"https://api.github.com/users/infusionvlc/orgs","repos_url":"https://api.github.com/users/infusionvlc/repos","events_url":"https://api.github.com/users/infusionvlc/events{/privacy}","received_events_url":"https://api.github.com/users/infusionvlc/received_events","type":"Organization","site_admin":false},"repo":{"id":150881554,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA4ODE1NTQ=","name":"somnium_server","full_name":"infusionvlc/somnium_server","private":false,"owner":{"login":"infusionvlc","id":34789689,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0Nzg5Njg5","avatar_url":"https://avatars2.githubusercontent.com/u/34789689?v=4","gravatar_id":"","url":"https://api.github.com/users/infusionvlc","html_url":"https://github.com/infusionvlc","followers_url":"https://api.github.com/users/infusionvlc/followers","following_url":"https://api.github.com/users/infusionvlc/following{/other_user}","gists_url":"https://api.github.com/users/infusionvlc/gists{/gist_id}","starred_url":"https://api.github.com/users/infusionvlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infusionvlc/subscriptions","organizations_url":"https://api.github.com/users/infusionvlc/orgs","repos_url":"https://api.github.com/users/infusionvlc/repos","events_url":"https://api.github.com/users/infusionvlc/events{/privacy}","received_events_url":"https://api.github.com/users/infusionvlc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/infusionvlc/somnium_server","description":"A social dream dictionary and journal :purple_heart: :zzz:","fork":false,"url":"https://api.github.com/repos/infusionvlc/somnium_server","forks_url":"https://api.github.com/repos/infusionvlc/somnium_server/forks","keys_url":"https://api.github.com/repos/infusionvlc/somnium_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infusionvlc/somnium_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infusionvlc/somnium_server/teams","hooks_url":"https://api.github.com/repos/infusionvlc/somnium_server/hooks","issue_events_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/events{/number}","events_url":"https://api.github.com/repos/infusionvlc/somnium_server/events","assignees_url":"https://api.github.com/repos/infusionvlc/somnium_server/assignees{/user}","branches_url":"https://api.github.com/repos/infusionvlc/somnium_server/branches{/branch}","tags_url":"https://api.github.com/repos/infusionvlc/somnium_server/tags","blobs_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infusionvlc/somnium_server/statuses/{sha}","languages_url":"https://api.github.com/repos/infusionvlc/somnium_server/languages","stargazers_url":"https://api.github.com/repos/infusionvlc/somnium_server/stargazers","contributors_url":"https://api.github.com/repos/infusionvlc/somnium_server/contributors","subscribers_url":"https://api.github.com/repos/infusionvlc/somnium_server/subscribers","subscription_url":"https://api.github.com/repos/infusionvlc/somnium_server/subscription","commits_url":"https://api.github.com/repos/infusionvlc/somnium_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/infusionvlc/somnium_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/infusionvlc/somnium_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/infusionvlc/somnium_server/contents/{+path}","compare_url":"https://api.github.com/repos/infusionvlc/somnium_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infusionvlc/somnium_server/merges","archive_url":"https://api.github.com/repos/infusionvlc/somnium_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infusionvlc/somnium_server/downloads","issues_url":"https://api.github.com/repos/infusionvlc/somnium_server/issues{/number}","pulls_url":"https://api.github.com/repos/infusionvlc/somnium_server/pulls{/number}","milestones_url":"https://api.github.com/repos/infusionvlc/somnium_server/milestones{/number}","notifications_url":"https://api.github.com/repos/infusionvlc/somnium_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infusionvlc/somnium_server/labels{/name}","releases_url":"https://api.github.com/repos/infusionvlc/somnium_server/releases{/id}","deployments_url":"https://api.github.com/repos/infusionvlc/somnium_server/deployments","created_at":"2018-09-29T16:14:21Z","updated_at":"2018-09-30T17:55:13Z","pushed_at":"2018-10-01T22:54:49Z","git_url":"git://github.com/infusionvlc/somnium_server.git","ssh_url":"git@github.com:infusionvlc/somnium_server.git","clone_url":"https://github.com/infusionvlc/somnium_server.git","svn_url":"https://github.com/infusionvlc/somnium_server","homepage":"http://somnium.io","size":98,"stargazers_count":2,"watchers_count":2,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":1,"open_issues":19,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21"},"html":{"href":"https://github.com/infusionvlc/somnium_server/pull/21"},"issue":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/issues/21"},"comments":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/infusionvlc/somnium_server/statuses/ccc4fbbf45a9d8e372f64b610f0486fc80df93cf"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":122,"deletions":2,"changed_files":5}}
{"actor":{"display_login":"tonilopezmr"}}