Search in sources :

Example 1 with ObservableRange

use of io.reactivex.rxjava3.internal.operators.observable.ObservableRange in project RxJava by ReactiveX.

the class RxJavaPluginsTest method observableCreate.

@SuppressWarnings("rawtypes")
@Test
public void observableCreate() {
    try {
        RxJavaPlugins.setOnObservableAssembly(new Function<Observable, Observable>() {

            @Override
            public Observable apply(Observable t) {
                return new ObservableRange(1, 2);
            }
        });
        Observable.range(10, 3).test().assertValues(1, 2).assertNoErrors().assertComplete();
    } finally {
        RxJavaPlugins.reset();
    }
    // make sure the reset worked
    Observable.range(10, 3).test().assertValues(10, 11, 12).assertNoErrors().assertComplete();
}
Also used : ObservableRange(io.reactivex.rxjava3.internal.operators.observable.ObservableRange) Observable(io.reactivex.rxjava3.core.Observable) ConnectableObservable(io.reactivex.rxjava3.observables.ConnectableObservable) Test(org.junit.Test)

Aggregations

Observable (io.reactivex.rxjava3.core.Observable)1 ObservableRange (io.reactivex.rxjava3.internal.operators.observable.ObservableRange)1 ConnectableObservable (io.reactivex.rxjava3.observables.ConnectableObservable)1 Test (org.junit.Test)1