Class RxTestObserver<T>

  • All Implemented Interfaces:
    io.reactivex.rxjava3.core.CompletableObserver, io.reactivex.rxjava3.core.MaybeObserver<T>, io.reactivex.rxjava3.core.Observer<T>, io.reactivex.rxjava3.core.SingleObserver<T>, io.reactivex.rxjava3.disposables.Disposable, RxTestAdapter<T>

    public final class RxTestObserver<T>
    extends io.reactivex.rxjava3.observers.TestObserver<T>
    implements RxTestAdapter<T>
    • Field Summary

      • Fields inherited from class io.reactivex.rxjava3.observers.BaseTestConsumer

        checkSubscriptionOnce, completions, done, errors, lastThread, tag, timeout, values
    • Constructor Summary

      Constructors 
      Constructor Description
      RxTestObserver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ack​(int count)  
      void awaitNext​(int count)
      Waits (at most 5 seconds) for at least count values to be emitted.
      long completions()  
      java.lang.Iterable<java.lang.Throwable> errors()  
      boolean isCancelled()  
      java.util.Collection<T> newValues​(int count)
      Returns the next count values that have not been acknowledged so far.
      • Methods inherited from class io.reactivex.rxjava3.observers.TestObserver

        assertSubscribed, create, create, dispose, hasSubscription, isDisposed, onComplete, onError, onNext, onSubscribe, onSuccess
      • Methods inherited from class io.reactivex.rxjava3.observers.BaseTestConsumer

        assertComplete, assertEmpty, assertError, assertError, assertError, assertFailure, assertNoErrors, assertNotComplete, assertNoValues, assertResult, assertValue, assertValue, assertValueAt, assertValueAt, assertValueCount, assertValues, assertValueSequence, assertValuesOnly, await, await, awaitCount, awaitDone, fail, valueAndClass, values, withTag
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RxTestObserver

        public RxTestObserver()
    • Method Detail

      • newValues

        public java.util.Collection<T> newValues​(int count)
        Description copied from interface: RxTestAdapter
        Returns the next count values that have not been acknowledged so far. The result will have fewer elements if no count elements have been emitted.
        Specified by:
        newValues in interface RxTestAdapter<T>
      • awaitNext

        public void awaitNext​(int count)
        Description copied from interface: RxTestAdapter
        Waits (at most 5 seconds) for at least count values to be emitted. This method returns without an error even if no count have been emitted.
        Specified by:
        awaitNext in interface RxTestAdapter<T>
      • ack

        public void ack​(int count)
        Specified by:
        ack in interface RxTestAdapter<T>
      • errors

        public java.lang.Iterable<java.lang.Throwable> errors()
        Specified by:
        errors in interface RxTestAdapter<T>