@Test public void onErrorIsCalledWhenOwnerIdsCannotBeObserved() { Throwable testThrowable = new Throwable("test throwable"); setupErroringValueEventListenerFor(mockListeners, mockOwnersDb, testThrowable); Observable<List<String>> listObservable = firebaseChannelsDatabase.observeOwnerIdsFor(newChannel); assertThrowableReceivedOnError(listObservable, testThrowable); }
@Override public Observable<List<String>> observeOwnerIdsFor(Channel channel) { return firebaseObservableListeners.listenToValueEvents(ownersDB.child(channel.getName()), getKeys()); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observeOwnerIdsFor(Channel channel) { return firebaseObservableListeners.listenToValueEvents(ownersDB.child(channel.getName()), getKeys()); } }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observeOwnerIdsFor(Channel channel) { return firebaseObservableListeners.listenToValueEvents(ownersDB.child(channel.getName()), getKeys()); } FirebaseChannelsDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observeOwnerIdsFor(Channel channel) { return firebaseObservableListeners.listenToValueEvents(ownersDB.child(channel.getName()), getKeys()); } FirebaseChannelsDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<List<String>> observePublicChannelIds(); @Override Observable<List<String>> observePrivateChannelIdsFor(User user); @Override Observable<Channel> readChannelFor(String channelName); @Override Observable<Channel> writeChannel(Channel newChannel); @Override Observable<Channel> writeChannelToPublicChannelIndex(Channel newChannel); @Override Observable<Channel> addOwnerToPrivateChannel(User user, Channel channel); @Override Observable<Channel> removeOwnerFromPrivateChannel(User user, Channel channel); @Override Observable<Channel> addChannelToUserPrivateChannelIndex(User user, Channel channel); @Override Observable<Channel> removeChannelFromUserPrivateChannelIndex(User user, Channel channel); @Override Observable<List<String>> observeOwnerIdsFor(Channel channel); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observeOwnerIdsFor(Channel channel) { return firebaseObservableListeners.listenToValueEvents(ownersDB.child(channel.getName()), getKeys()); } FirebaseChannelsDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<List<String>> observePublicChannelIds(); @Override Observable<List<String>> observePrivateChannelIdsFor(User user); @Override Observable<Channel> readChannelFor(String channelName); @Override Observable<Channel> writeChannel(Channel newChannel); @Override Observable<Channel> writeChannelToPublicChannelIndex(Channel newChannel); @Override Observable<Channel> addOwnerToPrivateChannel(User user, Channel channel); @Override Observable<Channel> removeOwnerFromPrivateChannel(User user, Channel channel); @Override Observable<Channel> addChannelToUserPrivateChannelIndex(User user, Channel channel); @Override Observable<Channel> removeChannelFromUserPrivateChannelIndex(User user, Channel channel); @Override Observable<List<String>> observeOwnerIdsFor(Channel channel);  }