@Test public void subscriberReceivesErrorWhenChatCannotBeObserved() { Throwable testThrowable = new Throwable("test throwable"); setupErroringValueEventListenerFor(mockListeners, mockMessagesDatabase, testThrowable); Observable<Chat> observable = firebaseChatDatabase.observeChat(channel); assertThrowableReceivedOnError(observable, testThrowable); }
@Override public Observable<Chat> observeChat(Channel channel) { return firebaseObservableListeners.listenToValueEvents(messagesInChannel(channel).limitToLast(DEFAULT_LIMIT), toChat()); }
FirebaseChatDatabase implements ChatDatabase { @Override public Observable<Chat> observeChat(Channel channel) { return firebaseObservableListeners.listenToValueEvents(messagesInChannel(channel).limitToLast(DEFAULT_LIMIT), toChat()); } }
FirebaseChatDatabase implements ChatDatabase { @Override public Observable<Chat> observeChat(Channel channel) { return firebaseObservableListeners.listenToValueEvents(messagesInChannel(channel).limitToLast(DEFAULT_LIMIT), toChat()); } FirebaseChatDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); }
FirebaseChatDatabase implements ChatDatabase { @Override public Observable<Chat> observeChat(Channel channel) { return firebaseObservableListeners.listenToValueEvents(messagesInChannel(channel).limitToLast(DEFAULT_LIMIT), toChat()); } FirebaseChatDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<Chat> observeChat(Channel channel); @Override void sendMessage(Channel channel, Message message); }
FirebaseChatDatabase implements ChatDatabase { @Override public Observable<Chat> observeChat(Channel channel) { return firebaseObservableListeners.listenToValueEvents(messagesInChannel(channel).limitToLast(DEFAULT_LIMIT), toChat()); } FirebaseChatDatabase(FirebaseDatabase firebaseDatabase, FirebaseObservableListeners firebaseObservableListeners); @Override Observable<Chat> observeChat(Channel channel); @Override void sendMessage(Channel channel, Message message);  }