{"action":"created","comment":{"url":"https://api.github.com/repos/nextcloud/android/pulls/comments/184307470","pull_request_review_id":115474546,"id":184307470,"diff_hunk":"@@ -0,0 +1,59 @@\n+package com.owncloud.android.ui.activities.data.activities;\n+\n+import com.owncloud.android.lib.common.OwnCloudClient;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.mockito.ArgumentCaptor;\n+import org.mockito.Captor;\n+import org.mockito.Mock;\n+import org.mockito.MockitoAnnotations;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import static org.mockito.Matchers.eq;\n+import static org.mockito.Mockito.verify;\n+\n+public class RemoteActivitiesRepositoryTest {\n+\n+    @Mock","path":"src/test/java/com/owncloud/android/ui/activities/data/activities/RemoteActivitiesRepositoryTest.java","position":20,"original_position":20,"commit_id":"e4b20211ecb4e0ea9cb48d2be50f9727bd6dc49d","original_commit_id":"e4b20211ecb4e0ea9cb48d2be50f9727bd6dc49d","user":{"login":"ardevd","id":366855,"avatar_url":"https://avatars1.githubusercontent.com/u/366855?v=4","gravatar_id":"","url":"https://api.github.com/users/ardevd","html_url":"https://github.com/ardevd","followers_url":"https://api.github.com/users/ardevd/followers","following_url":"https://api.github.com/users/ardevd/following{/other_user}","gists_url":"https://api.github.com/users/ardevd/gists{/gist_id}","starred_url":"https://api.github.com/users/ardevd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardevd/subscriptions","organizations_url":"https://api.github.com/users/ardevd/orgs","repos_url":"https://api.github.com/users/ardevd/repos","events_url":"https://api.github.com/users/ardevd/events{/privacy}","received_events_url":"https://api.github.com/users/ardevd/received_events","type":"User","site_admin":false},"body":"Not sure why it's only raising this issue with the RemoteActivitiesRepositoryTest class and not the other unit test classes.","created_at":"2018-04-26T08:27:09Z","updated_at":"2018-04-26T08:27:09Z","html_url":"https://github.com/nextcloud/android/pull/2504#discussion_r184307470","pull_request_url":"https://api.github.com/repos/nextcloud/android/pulls/2504","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nextcloud/android/pulls/comments/184307470"},"html":{"href":"https://github.com/nextcloud/android/pull/2504#discussion_r184307470"},"pull_request":{"href":"https://api.github.com/repos/nextcloud/android/pulls/2504"}},"in_reply_to_id":184306379},"pull_request":{"url":"https://api.github.com/repos/nextcloud/android/pulls/2504","id":183411876,"html_url":"https://github.com/nextcloud/android/pull/2504","diff_url":"https://github.com/nextcloud/android/pull/2504.diff","patch_url":"https://github.com/nextcloud/android/pull/2504.patch","issue_url":"https://api.github.com/repos/nextcloud/android/issues/2504","number":2504,"state":"open","locked":false,"title":"[MVP] Refactored the Activities activity","user":{"login":"ardevd","id":366855,"avatar_url":"https://avatars1.githubusercontent.com/u/366855?v=4","gravatar_id":"","url":"https://api.github.com/users/ardevd","html_url":"https://github.com/ardevd","followers_url":"https://api.github.com/users/ardevd/followers","following_url":"https://api.github.com/users/ardevd/following{/other_user}","gists_url":"https://api.github.com/users/ardevd/gists{/gist_id}","starred_url":"https://api.github.com/users/ardevd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardevd/subscriptions","organizations_url":"https://api.github.com/users/ardevd/orgs","repos_url":"https://api.github.com/users/ardevd/repos","events_url":"https://api.github.com/users/ardevd/events{/privacy}","received_events_url":"https://api.github.com/users/ardevd/received_events","type":"User","site_admin":false},"body":"I have refactored the entire Activities List activity.\r\n\r\nThe old activity class has been split up into a View (Activity) and a Presenter with a Contract interface that connects them. Additionally, I have implemented a repository pattern for all remote data access. Currently I've kept things specific to the Activities screen but it would be possible to use it for all remote data operations throughout the app instead of the various duplicate AsyncTasks and Thread implementations you currently have.\r\n\r\nI have added unit tests with a 100% coverage for the Presenter and the Files and Activities repository data classes. Instrumented tests can be written to cover the View. \r\n\r\nNote that when launching the activities screen you will currently see a NullPointerException due to #2502. Applying #2503 fixes the issue it seems.\r\n\r\nI've taken some liberties and cleaned up some stuff that just didnt make sense to me. Most notably the multiple ways progress was being shown to the user. I think the SwipeToRefresh-indicator sufficiently indicates  progress to the user so I removed the `emptyContentProgressBar` progress indicator by setting it to Invisible. I also removed the funky way you guys showed the empty content view when no activities are available. You had a separate RecylerView with an associated RecylerView  for empty content to give the user the ability to swipe-to-refresh when no activities where shown in the list. I simplified this by removing the redundant recyclerview all-together by moving the included `empty_list` view into the primary `SwipeRefreshLayout` used for the recyclerView used for actually displaying Activities and simply toggling visibility according to the availability of activities. Looks a lot cleaner to me :) \r\n\r\nFinally, this is still WIP. I'm sure there's a bunch of stuff I've missed and corner cases I havent accounted for. The obvious TODO's I've identified is getting rid of the hardcoded error strings and replace them with string resources. (The old implementation also used hardcoded strings btw). Furthermore, it would be nice to get rid of the Toast messages and replace them with as Snackbar message instead. I saw some discussion somewhere yesterday of doing that globally through the app so I'll leave that up to you guys for now as that can easily be fixed later.\r\n\r\nLooking forward to your feedback. Hope this makes sense. There is still room for a lot of cleanup here but at least it's a lot nicer than it was imho.","created_at":"2018-04-23T12:02:50Z","updated_at":"2018-04-26T08:27:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d2d15d9af359f86522e9b2c3d36a75130ad50f8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"AndyScherzinger","id":1315170,"avatar_url":"https://avatars3.githubusercontent.com/u/1315170?v=4","gravatar_id":"","url":"https://api.github.com/users/AndyScherzinger","html_url":"https://github.com/AndyScherzinger","followers_url":"https://api.github.com/users/AndyScherzinger/followers","following_url":"https://api.github.com/users/AndyScherzinger/following{/other_user}","gists_url":"https://api.github.com/users/AndyScherzinger/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyScherzinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyScherzinger/subscriptions","organizations_url":"https://api.github.com/users/AndyScherzinger/orgs","repos_url":"https://api.github.com/users/AndyScherzinger/repos","events_url":"https://api.github.com/users/AndyScherzinger/events{/privacy}","received_events_url":"https://api.github.com/users/AndyScherzinger/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":392413889,"url":"https://api.github.com/repos/nextcloud/android/labels/2.%20to%20review","name":"2. to review","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nextcloud/android/pulls/2504/commits","review_comments_url":"https://api.github.com/repos/nextcloud/android/pulls/2504/comments","review_comment_url":"https://api.github.com/repos/nextcloud/android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nextcloud/android/issues/2504/comments","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/e4b20211ecb4e0ea9cb48d2be50f9727bd6dc49d","head":{"label":"nextcloud:2474-feature-mvp-activities","ref":"2474-feature-mvp-activities","sha":"e4b20211ecb4e0ea9cb48d2be50f9727bd6dc49d","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60561834,"name":"android","full_name":"nextcloud/android","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/android","description":"📱 Nextcloud Android app","fork":false,"url":"https://api.github.com/repos/nextcloud/android","forks_url":"https://api.github.com/repos/nextcloud/android/forks","keys_url":"https://api.github.com/repos/nextcloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/android/teams","hooks_url":"https://api.github.com/repos/nextcloud/android/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/android/events","assignees_url":"https://api.github.com/repos/nextcloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/android/tags","blobs_url":"https://api.github.com/repos/nextcloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/android/languages","stargazers_url":"https://api.github.com/repos/nextcloud/android/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/android/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/android/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/android/subscription","commits_url":"https://api.github.com/repos/nextcloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/android/merges","archive_url":"https://api.github.com/repos/nextcloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/android/downloads","issues_url":"https://api.github.com/repos/nextcloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/android/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/android/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/android/deployments","created_at":"2016-06-06T21:23:36Z","updated_at":"2018-04-26T07:56:49Z","pushed_at":"2018-04-26T08:19:39Z","git_url":"git://github.com/nextcloud/android.git","ssh_url":"git@github.com:nextcloud/android.git","clone_url":"https://github.com/nextcloud/android.git","svn_url":"https://github.com/nextcloud/android","homepage":"https://play.google.com/store/apps/details?id=com.nextcloud.client","size":96396,"stargazers_count":716,"watchers_count":716,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":402,"mirror_url":null,"archived":false,"open_issues_count":565,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":402,"open_issues":565,"watchers":716,"default_branch":"master"}},"base":{"label":"nextcloud:master","ref":"master","sha":"3aad742e0c1f9d4f44c96bd2b9ca5863c9efb1f6","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60561834,"name":"android","full_name":"nextcloud/android","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/android","description":"📱 Nextcloud Android app","fork":false,"url":"https://api.github.com/repos/nextcloud/android","forks_url":"https://api.github.com/repos/nextcloud/android/forks","keys_url":"https://api.github.com/repos/nextcloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/android/teams","hooks_url":"https://api.github.com/repos/nextcloud/android/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/android/events","assignees_url":"https://api.github.com/repos/nextcloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/android/tags","blobs_url":"https://api.github.com/repos/nextcloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/android/languages","stargazers_url":"https://api.github.com/repos/nextcloud/android/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/android/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/android/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/android/subscription","commits_url":"https://api.github.com/repos/nextcloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/android/merges","archive_url":"https://api.github.com/repos/nextcloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/android/downloads","issues_url":"https://api.github.com/repos/nextcloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/android/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/android/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/android/deployments","created_at":"2016-06-06T21:23:36Z","updated_at":"2018-04-26T07:56:49Z","pushed_at":"2018-04-26T08:19:39Z","git_url":"git://github.com/nextcloud/android.git","ssh_url":"git@github.com:nextcloud/android.git","clone_url":"https://github.com/nextcloud/android.git","svn_url":"https://github.com/nextcloud/android","homepage":"https://play.google.com/store/apps/details?id=com.nextcloud.client","size":96396,"stargazers_count":716,"watchers_count":716,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":402,"mirror_url":null,"archived":false,"open_issues_count":565,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":402,"open_issues":565,"watchers":716,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nextcloud/android/pulls/2504"},"html":{"href":"https://github.com/nextcloud/android/pull/2504"},"issue":{"href":"https://api.github.com/repos/nextcloud/android/issues/2504"},"comments":{"href":"https://api.github.com/repos/nextcloud/android/issues/2504/comments"},"review_comments":{"href":"https://api.github.com/repos/nextcloud/android/pulls/2504/comments"},"review_comment":{"href":"https://api.github.com/repos/nextcloud/android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nextcloud/android/pulls/2504/commits"},"statuses":{"href":"https://api.github.com/repos/nextcloud/android/statuses/e4b20211ecb4e0ea9cb48d2be50f9727bd6dc49d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ardevd"}}