{"action":"closed","number":865,"pull_request":{"url":"https://api.github.com/repos/Talend/components/pulls/865","id":127919316,"html_url":"https://github.com/Talend/components/pull/865","diff_url":"https://github.com/Talend/components/pull/865.diff","patch_url":"https://github.com/Talend/components/pull/865.patch","issue_url":"https://api.github.com/repos/Talend/components/issues/865","number":865,"state":"closed","locked":false,"title":"chore(TCOMP-216): define reader main use cases for tests","user":{"login":"akhabali","id":25590305,"avatar_url":"https://avatars3.githubusercontent.com/u/25590305?v=4","gravatar_id":"","url":"https://api.github.com/users/akhabali","html_url":"https://github.com/akhabali","followers_url":"https://api.github.com/users/akhabali/followers","following_url":"https://api.github.com/users/akhabali/following{/other_user}","gists_url":"https://api.github.com/users/akhabali/gists{/gist_id}","starred_url":"https://api.github.com/users/akhabali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akhabali/subscriptions","organizations_url":"https://api.github.com/users/akhabali/orgs","repos_url":"https://api.github.com/users/akhabali/repos","events_url":"https://api.github.com/users/akhabali/events{/privacy}","received_events_url":"https://api.github.com/users/akhabali/received_events","type":"User","site_admin":false},"body":"**What is the current behavior?** (You can also link to an open issue here)\r\n\r\n**What is the new behavior?**\r\nDefine a set of tests that cover the main states of a data source (empty, contain only one element, has multiple element or it unavailable).  those  states should be handled correctly by a Reader .\r\n\r\nEvery reader Test should implement SourceReaderTest and validate the use cases.\r\n\r\nAn matchers set is available in the class ReaderMatchers that can be used while testing a Reader (to assert that the reader: canStart(), canAdvance() ...)\r\n\r\nAn implementation example is available in the package org/talend/components/api/component/runtime/example\r\n\r\nIn the implementation example you fin a recommended way to code the Reader class by introducing a ReaderService that should wrap all the external api calls to make it easy to test the Reader logic by mocking the ReaderService and emulating the api behavior. \r\nThis make it possible to test the code logic in unit test instead of integration test that depends on external system and that can be unstable. \r\n\r\n**Please check if the PR fulfills these requirements**\r\n\r\n- [ ] The commit message follows Talend standard\r\n- [ ] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features) ?\r\n- [ ] The code coverage on new code >75%\r\n- [ ] The new code does not introduce new technical issues (sonar / eslint)\r\n\r\n**What kind of change does this PR introduce?**\r\n\r\n- [ ] Bugfix\r\n- [ ] Feature\r\n- [ ] Code style update (formatting, local variables)\r\n- [ ] Refactoring (no functional changes, no api changes)\r\n- [ ] Build / CI related changes\r\n- [ ] Other... Please describe:\r\n\r\n**Does this PR introduce a breaking change?**\r\n\r\n- [ ] Yes\r\n- [x] No\r\n\r\nIf this PR contains a breaking change, please describe the impact and migration path for existing applications: ...\r\n\r\n\r\n**Other information**:\r\n","created_at":"2017-06-28T13:13:35Z","updated_at":"2017-12-27T08:55:24Z","closed_at":"2017-12-27T08:55:24Z","merged_at":null,"merge_commit_sha":"4258a325c4d75cde73fcc180163afbeee7340640","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pteyssier","id":588681,"avatar_url":"https://avatars1.githubusercontent.com/u/588681?v=4","gravatar_id":"","url":"https://api.github.com/users/pteyssier","html_url":"https://github.com/pteyssier","followers_url":"https://api.github.com/users/pteyssier/followers","following_url":"https://api.github.com/users/pteyssier/following{/other_user}","gists_url":"https://api.github.com/users/pteyssier/gists{/gist_id}","starred_url":"https://api.github.com/users/pteyssier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pteyssier/subscriptions","organizations_url":"https://api.github.com/users/pteyssier/orgs","repos_url":"https://api.github.com/users/pteyssier/repos","events_url":"https://api.github.com/users/pteyssier/events{/privacy}","received_events_url":"https://api.github.com/users/pteyssier/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Talend/components/pulls/865/commits","review_comments_url":"https://api.github.com/repos/Talend/components/pulls/865/comments","review_comment_url":"https://api.github.com/repos/Talend/components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Talend/components/issues/865/comments","statuses_url":"https://api.github.com/repos/Talend/components/statuses/1996180465175988218e4012a4aa289da34d2594","head":{"label":"Talend:akahabli/TCOMP-216-test_usecases","ref":"akahabli/TCOMP-216-test_usecases","sha":"1996180465175988218e4012a4aa289da34d2594","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":39855061,"name":"components","full_name":"Talend/components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/components","description":"Talend component infrastructure and public components","fork":false,"url":"https://api.github.com/repos/Talend/components","forks_url":"https://api.github.com/repos/Talend/components/forks","keys_url":"https://api.github.com/repos/Talend/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/components/teams","hooks_url":"https://api.github.com/repos/Talend/components/hooks","issue_events_url":"https://api.github.com/repos/Talend/components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/components/events","assignees_url":"https://api.github.com/repos/Talend/components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/components/tags","blobs_url":"https://api.github.com/repos/Talend/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/components/languages","stargazers_url":"https://api.github.com/repos/Talend/components/stargazers","contributors_url":"https://api.github.com/repos/Talend/components/contributors","subscribers_url":"https://api.github.com/repos/Talend/components/subscribers","subscription_url":"https://api.github.com/repos/Talend/components/subscription","commits_url":"https://api.github.com/repos/Talend/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/components/merges","archive_url":"https://api.github.com/repos/Talend/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/components/downloads","issues_url":"https://api.github.com/repos/Talend/components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/components/deployments","created_at":"2015-07-28T20:02:50Z","updated_at":"2017-11-01T20:09:32Z","pushed_at":"2017-12-27T08:52:17Z","git_url":"git://github.com/Talend/components.git","ssh_url":"git@github.com:Talend/components.git","clone_url":"https://github.com/Talend/components.git","svn_url":"https://github.com/Talend/components","homepage":null,"size":16298,"stargazers_count":19,"watchers_count":19,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":37,"open_issues":18,"watchers":19,"default_branch":"master"}},"base":{"label":"Talend:master","ref":"master","sha":"2c1504750ed4ba69f81d1b49f40c9da9eb355b90","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":39855061,"name":"components","full_name":"Talend/components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/components","description":"Talend component infrastructure and public components","fork":false,"url":"https://api.github.com/repos/Talend/components","forks_url":"https://api.github.com/repos/Talend/components/forks","keys_url":"https://api.github.com/repos/Talend/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/components/teams","hooks_url":"https://api.github.com/repos/Talend/components/hooks","issue_events_url":"https://api.github.com/repos/Talend/components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/components/events","assignees_url":"https://api.github.com/repos/Talend/components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/components/tags","blobs_url":"https://api.github.com/repos/Talend/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/components/languages","stargazers_url":"https://api.github.com/repos/Talend/components/stargazers","contributors_url":"https://api.github.com/repos/Talend/components/contributors","subscribers_url":"https://api.github.com/repos/Talend/components/subscribers","subscription_url":"https://api.github.com/repos/Talend/components/subscription","commits_url":"https://api.github.com/repos/Talend/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/components/merges","archive_url":"https://api.github.com/repos/Talend/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/components/downloads","issues_url":"https://api.github.com/repos/Talend/components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/components/deployments","created_at":"2015-07-28T20:02:50Z","updated_at":"2017-11-01T20:09:32Z","pushed_at":"2017-12-27T08:52:17Z","git_url":"git://github.com/Talend/components.git","ssh_url":"git@github.com:Talend/components.git","clone_url":"https://github.com/Talend/components.git","svn_url":"https://github.com/Talend/components","homepage":null,"size":16298,"stargazers_count":19,"watchers_count":19,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":37,"open_issues":18,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Talend/components/pulls/865"},"html":{"href":"https://github.com/Talend/components/pull/865"},"issue":{"href":"https://api.github.com/repos/Talend/components/issues/865"},"comments":{"href":"https://api.github.com/repos/Talend/components/issues/865/comments"},"review_comments":{"href":"https://api.github.com/repos/Talend/components/pulls/865/comments"},"review_comment":{"href":"https://api.github.com/repos/Talend/components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Talend/components/pulls/865/commits"},"statuses":{"href":"https://api.github.com/repos/Talend/components/statuses/1996180465175988218e4012a4aa289da34d2594"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":11,"review_comments":23,"maintainer_can_modify":false,"commits":13,"additions":1278,"deletions":810,"changed_files":20}}
{"actor":{"display_login":"akhabali"}}