android - Can't subscribe on a RxJava 2 Observable with TestSubscriber -
why compiler not allowing myself subscribe on observable testsubscriber?
here's code:
testsubscriber<user> testsubscriber = new testsubscriber<>(); observable.just(new user()).subscribe(testsubscriber);
and it's saying can't resolve method subscribe
taking parameter. in rxjava testing tutorials, using testsubscriber without such problems. can test such observable?
it because *subscriber
meant flowable
while observable
uses *observer
classes. because reactive-streams standard reserves subscriber
compliant publisher
interface flowable
implements.
additionally rxjava2 reactive classes have .test()
method directly give appropriate testing object.
Comments
Post a Comment