@Test public void whenUsersCannotBeObservedOnErrorIsCalled() { Throwable testThrowable = new Throwable("test error"); setupErroringValueEventListenerFor(mockListeners, mockUsersDatabase, testThrowable); Observable<Users> usersObservable = firebaseUserDatabase.observeUsers(); assertThrowableReceivedOnError(usersObservable, testThrowable); }
@Override public Observable<Users> observeUsers() { return firebaseObservableListeners.listenToValueEvents(usersDB, toUsers()); }
FirebaseUserDatabase implements UserDatabase { @Override public Observable<Users> observeUsers() { return firebaseObservableListeners.listenToValueEvents(usersDB, toUsers()); } }
FirebaseUserDatabase implements UserDatabase { @Override public Observable<Users> observeUsers() { return firebaseObservableListeners.listenToValueEvents(usersDB, toUsers()); } FirebaseUserDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); }
FirebaseUserDatabase implements UserDatabase { @Override public Observable<Users> observeUsers() { return firebaseObservableListeners.listenToValueEvents(usersDB, toUsers()); } FirebaseUserDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<Users> observeUsers(); @Override Observable<User> readUserFrom(String userId); @Override Observable<User> observeUser(String userId); @Override void writeCurrentUser(User user); }
FirebaseUserDatabase implements UserDatabase { @Override public Observable<Users> observeUsers() { return firebaseObservableListeners.listenToValueEvents(usersDB, toUsers()); } FirebaseUserDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<Users> observeUsers(); @Override Observable<User> readUserFrom(String userId); @Override Observable<User> observeUser(String userId); @Override void writeCurrentUser(User user);  }