LogOutAction { public Observable<Void> logOut() { return Observable.concat(userDataSource.removeCurrentUser(), logoutFromFirebase()); } LogOutAction(UserDataSource userDataSource, FirebaseAuth firebaseAuth); Observable<Void> logOut();  }
@Test public void logouts_from_datasource() throws Exception { action.logOut() .toBlocking().subscribe(); verify(userDataSource).removeCurrentUser(); }
@Test public void logouts_from_firebase() throws Exception { action.logOut() .toBlocking().subscribe(); verify(firebaseAuth).signOut(); }