{"action":"created","issue":{"url":"https://api.github.com/repos/novoda/spikes/issues/71","repository_url":"https://api.github.com/repos/novoda/spikes","labels_url":"https://api.github.com/repos/novoda/spikes/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/novoda/spikes/issues/71/comments","events_url":"https://api.github.com/repos/novoda/spikes/issues/71/events","html_url":"https://github.com/novoda/spikes/pull/71","id":158363677,"number":71,"title":"Firebase/feature/test database classes","user":{"login":"joetimmins","id":10560214,"avatar_url":"https://avatars.githubusercontent.com/u/10560214?v=3","gravatar_id":"","url":"https://api.github.com/users/joetimmins","html_url":"https://github.com/joetimmins","followers_url":"https://api.github.com/users/joetimmins/followers","following_url":"https://api.github.com/users/joetimmins/following{/other_user}","gists_url":"https://api.github.com/users/joetimmins/gists{/gist_id}","starred_url":"https://api.github.com/users/joetimmins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joetimmins/subscriptions","organizations_url":"https://api.github.com/users/joetimmins/orgs","repos_url":"https://api.github.com/users/joetimmins/repos","events_url":"https://api.github.com/users/joetimmins/events{/privacy}","received_events_url":"https://api.github.com/users/joetimmins/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/novoda/spikes/labels/pt-firebase","name":"pt-firebase","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-03T13:09:49Z","updated_at":"2016-06-06T10:27:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/novoda/spikes/pulls/71","html_url":"https://github.com/novoda/spikes/pull/71","diff_url":"https://github.com/novoda/spikes/pull/71.diff","patch_url":"https://github.com/novoda/spikes/pull/71.patch"},"body":"This PR adds unit tests for the Firebase database classes that are in the `app` module. We wanted to get some test coverage around this for three reasons - to catch any bugs in the code we use to talk to Firebase, to enable us to refactor more safely and to improve the design of our classes by making them more testable.\r\n\r\nIn order to do this some static methods that set up the various different Firebase database listeners were converted to instance methods on the FirebaseObservableListeners class. This was purely because Mockito doesn't allow mocking of static methods.\r\n\r\nOnce it was possible to inject some mock values for the FirebaseObservableListeners, the return values could be stubbed out, either using implementations of Mockito's `Answer` interface or simple return values. Across the three classes that depend on `FirebaseDatabase` there were some common patterns in setting up the necessary test dependences so these have been moved into the `FirebaseTestHelpers` class."},"comment":{"url":"https://api.github.com/repos/novoda/spikes/issues/comments/223922141","html_url":"https://github.com/novoda/spikes/pull/71#issuecomment-223922141","issue_url":"https://api.github.com/repos/novoda/spikes/issues/71","id":223922141,"user":{"login":"joetimmins","id":10560214,"avatar_url":"https://avatars.githubusercontent.com/u/10560214?v=3","gravatar_id":"","url":"https://api.github.com/users/joetimmins","html_url":"https://github.com/joetimmins","followers_url":"https://api.github.com/users/joetimmins/followers","following_url":"https://api.github.com/users/joetimmins/following{/other_user}","gists_url":"https://api.github.com/users/joetimmins/gists{/gist_id}","starred_url":"https://api.github.com/users/joetimmins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joetimmins/subscriptions","organizations_url":"https://api.github.com/users/joetimmins/orgs","repos_url":"https://api.github.com/users/joetimmins/repos","events_url":"https://api.github.com/users/joetimmins/events{/privacy}","received_events_url":"https://api.github.com/users/joetimmins/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T10:27:04Z","updated_at":"2016-06-06T10:27:04Z","body":"Updated to use TestSubscribers in the FirebaseTestHelpers class. Only had to change that one class instead of all the database test classes :)"}}
{"actor":{"display_login":"joetimmins"}}