@Test public void querySearch_doesNotEmitError_whenQuerySearchErrors() { new Arrangement().withSearchResultError(new Exception()); defaultSearchDataModel.querySearch("should-error", Completable.complete()) .test() .assertComplete(); }
@NonNull @Override public Completable querySearch(@NonNull final String query, @NonNull final Completable preliminaryTask) { return preliminaryTask.doOnSubscribe(__ -> reportInProgress()) .andThen(freeSoundApiService.search(get(query)) .map(DefaultSearchDataModel::toResults) .doOnSuccess(this::reportResults) .doOnError(this::reportError) .toCompletable() .onErrorComplete()); }
DefaultSearchDataModel implements SearchDataModel { @NonNull @Override public Completable querySearch(@NonNull final String query, @NonNull final Completable preliminaryTask) { return preliminaryTask.doOnSubscribe(__ -> reportInProgress()) .andThen(freeSoundApiService.search(get(query)) .map(DefaultSearchDataModel::toResults) .doOnSuccess(this::reportResults) .doOnError(this::reportError) .toCompletable() .onErrorComplete()); } }
DefaultSearchDataModel implements SearchDataModel { @NonNull @Override public Completable querySearch(@NonNull final String query, @NonNull final Completable preliminaryTask) { return preliminaryTask.doOnSubscribe(__ -> reportInProgress()) .andThen(freeSoundApiService.search(get(query)) .map(DefaultSearchDataModel::toResults) .doOnSuccess(this::reportResults) .doOnError(this::reportError) .toCompletable() .onErrorComplete()); } DefaultSearchDataModel(@NonNull final FreeSoundApiService freeSoundApiService,
                           @NonNull final SchedulerProvider schedulerProvider); }
DefaultSearchDataModel implements SearchDataModel { @NonNull @Override public Completable querySearch(@NonNull final String query, @NonNull final Completable preliminaryTask) { return preliminaryTask.doOnSubscribe(__ -> reportInProgress()) .andThen(freeSoundApiService.search(get(query)) .map(DefaultSearchDataModel::toResults) .doOnSuccess(this::reportResults) .doOnError(this::reportError) .toCompletable() .onErrorComplete()); } DefaultSearchDataModel(@NonNull final FreeSoundApiService freeSoundApiService,
                           @NonNull final SchedulerProvider schedulerProvider); @NonNull @Override Completable querySearch(@NonNull final String query,
                                   @NonNull final Completable preliminaryTask); @Override @NonNull Observable<SearchState> getSearchStateOnceAndStream(); @Override @NonNull Completable clear(); }
DefaultSearchDataModel implements SearchDataModel { @NonNull @Override public Completable querySearch(@NonNull final String query, @NonNull final Completable preliminaryTask) { return preliminaryTask.doOnSubscribe(__ -> reportInProgress()) .andThen(freeSoundApiService.search(get(query)) .map(DefaultSearchDataModel::toResults) .doOnSuccess(this::reportResults) .doOnError(this::reportError) .toCompletable() .onErrorComplete()); } DefaultSearchDataModel(@NonNull final FreeSoundApiService freeSoundApiService,
                           @NonNull final SchedulerProvider schedulerProvider); @NonNull @Override Completable querySearch(@NonNull final String query,
                                   @NonNull final Completable preliminaryTask); @Override @NonNull Observable<SearchState> getSearchStateOnceAndStream(); @Override @NonNull Completable clear();  }