Class TestObserver<T>

java.lang.Object
io.reactivex.rxjava3.observers.BaseTestConsumer<T,TestObserver<T>>
io.reactivex.rxjava3.observers.TestObserver<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
CompletableObserver, MaybeObserver<T>, Observer<T>, SingleObserver<T>, Disposable

public class TestObserver<T> extends BaseTestConsumer<T,TestObserver<T>> implements Observer<T>, Disposable, MaybeObserver<T>, SingleObserver<T>, CompletableObserver
An Observer, MaybeObserver, SingleObserver and CompletableObserver composite that can record events from Observables, Maybes, Singles and Completables and allows making assertions about them.

You can override the onSubscribe(Disposable), onNext(Object), onError(Throwable), onComplete() and onSuccess(Object) methods but not the others (this is by design).

The TestObserver implements Disposable for convenience where dispose calls cancel.

See Also: