MainPresenter { @Nonnull Observable<Boolean> progressObservable() { return progressObservable; } MainPresenter(@Nonnull final PostsDao postsDao,
                         @Nonnull final MyCurrentLoggedInUserDao currentLoggedInUserDao,
                         @Nonnull Scheduler uiScheduler);   }
@Test public void testBeforeDownload_progressBarIsShown() throws Exception { final TestSubscriber<Boolean> progress = new TestSubscriber<>(); mainPresenter.progressObservable().subscribe(progress); assert_().that(progress.getOnNextEvents()) .isEqualTo(ImmutableList.of(true)); progress.assertNoErrors(); }
@Test public void testAfterDownload_progressBarIsHidden() throws Exception { final TestSubscriber<Boolean> progress = new TestSubscriber<>(); mainPresenter.progressObservable().subscribe(progress); postsSubject.onNext(sampleData()); scheduler.triggerActions(); assert_().that(progress.getOnNextEvents()) .isEqualTo(ImmutableList.of(true, false)); progress.assertNoErrors(); }