@Test public void applyWithProgressingAsFalseThenUpdateCitiesCount() { BehaviorSubject<Boolean> progressing = BehaviorSubject.createDefault(false); BehaviorSubject<Integer> citiesCount = BehaviorSubject.create(); new CountCitiesInteractor(progressing, citiesCount).apply(Flowable.just(10)); assertEquals(Integer.valueOf(10), citiesCount.getValue()); }
@Override public Publisher<Disposable> apply(Flowable<Integer> upstream) { return !progress.getValue() && citiesCount.getValue() == null ? Flowable.just(interact(upstream)) : Flowable.empty(); }
CountCitiesInteractor implements FlowableTransformer<Integer, Disposable> { @Override public Publisher<Disposable> apply(Flowable<Integer> upstream) { return !progress.getValue() && citiesCount.getValue() == null ? Flowable.just(interact(upstream)) : Flowable.empty(); } }
CountCitiesInteractor implements FlowableTransformer<Integer, Disposable> { @Override public Publisher<Disposable> apply(Flowable<Integer> upstream) { return !progress.getValue() && citiesCount.getValue() == null ? Flowable.just(interact(upstream)) : Flowable.empty(); } CountCitiesInteractor(@NonNull BehaviorSubject<Boolean> progress,
                          @NonNull BehaviorSubject<Integer> citiesCount); }
CountCitiesInteractor implements FlowableTransformer<Integer, Disposable> { @Override public Publisher<Disposable> apply(Flowable<Integer> upstream) { return !progress.getValue() && citiesCount.getValue() == null ? Flowable.just(interact(upstream)) : Flowable.empty(); } CountCitiesInteractor(@NonNull BehaviorSubject<Boolean> progress,
                          @NonNull BehaviorSubject<Integer> citiesCount); @Override Publisher<Disposable> apply(Flowable<Integer> upstream); }
CountCitiesInteractor implements FlowableTransformer<Integer, Disposable> { @Override public Publisher<Disposable> apply(Flowable<Integer> upstream) { return !progress.getValue() && citiesCount.getValue() == null ? Flowable.just(interact(upstream)) : Flowable.empty(); } CountCitiesInteractor(@NonNull BehaviorSubject<Boolean> progress,
                          @NonNull BehaviorSubject<Integer> citiesCount); @Override Publisher<Disposable> apply(Flowable<Integer> upstream);  }