There is something like TestSubscriber. It has very useful functions like awaitTerminalEvent(), getOnNextEvents(), etc.
Is there an equivalent of TestSubscriber for Observable that might be pinned to some observable in the middle of sequence?
I would like to test some specific cases, one of which is:
-
I have a class that accepts
Observablein constructor. One of it's methods invokes thatObservableinsideonErrorResumeNextoperator. So executing the mainObservableunder specific conditions might invoke testedObservable. Something likeassertExecutedis needed. -
In the case described above I would like to test
ThreadtheObservableis executed on. -
I would like to know, what
Observablereturned based on it's input.
Each of those cases require workarounds like:
observable
.doOnNext(o -> {
// Observable was given a value
});
If there is no nice way already available, how to make the call above cleaner?
Aucun commentaire:
Enregistrer un commentaire