@Test public void canSetNewChannelInChannelsDatabaseAndReturnIt() { Observable<Channel> channelObservable = firebaseChannelsDatabase.writeChannel(newChannel); assertValueReceivedOnNext(channelObservable, newChannel); }
@Override public Observable<Channel> writeChannel(Channel newChannel) { return firebaseObservableListeners.setValue(toFirebaseChannel(newChannel), channelsDB.child(newChannel.getName()), newChannel); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<Channel> writeChannel(Channel newChannel) { return firebaseObservableListeners.setValue(toFirebaseChannel(newChannel), channelsDB.child(newChannel.getName()), newChannel); } }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<Channel> writeChannel(Channel newChannel) { return firebaseObservableListeners.setValue(toFirebaseChannel(newChannel), channelsDB.child(newChannel.getName()), newChannel); } FirebaseChannelsDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); }
FirebaseChannelsDatabase implements ChannelsDatabase { @Override public Observable<Channel> writeChannel(Channel newChannel) { return firebaseObservableListeners.setValue(toFirebaseChannel(newChannel), channelsDB.child(newChannel.getName()), newChannel); } 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<Channel> writeChannel(Channel newChannel) { return firebaseObservableListeners.setValue(toFirebaseChannel(newChannel), channelsDB.child(newChannel.getName()), newChannel); } 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);  }