@Test public void onErrorIsCalledWhenPublicChannelIdsCannotBeObserved() { Throwable testThrowable = new Throwable("test throwable"); setupErroringValueEventListenerFor(mockListeners, mockPublicChannelsDb, testThrowable); Observable<List<String>> listObservable = firebaseChannelsDatabase.observePublicChannelIds(); assertThrowableReceivedOnError(listObservable, testThrowable); }
@Override public Observable<List<String>> observePublicChannelIds() { return firebaseObservableListeners.listenToValueEvents(publicChannelsDB, getKeys()); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observePublicChannelIds() { return firebaseObservableListeners.listenToValueEvents(publicChannelsDB, getKeys()); } }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observePublicChannelIds() { return firebaseObservableListeners.listenToValueEvents(publicChannelsDB, getKeys()); } FirebaseChannelsDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<List<String>> observePublicChannelIds() { return firebaseObservableListeners.listenToValueEvents(publicChannelsDB, 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>> observePublicChannelIds() { return firebaseObservableListeners.listenToValueEvents(publicChannelsDB, 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);  }