I am looking for a way to get the values returned from onNext in a subscriber so that I can check the results. TestSubscriber had a nice getOnNextEvent method , but when I use TestObserver I don’t see a method like this that I can use to get results to check it? Everything is out of date there, and when I check the IDE, it doesn't even appear there.
Here is what I want to check:
`@Test
public void buildUseCaseObservable(){
TestObserver subscriber = TestObserver.create();
standardLoginUsecase.buildUseCaseObservable().subscribe(subscriber);
subscriber.assertNoErrors();
subscriber.assertSubscribed();
subscriber.assertComplete();
}`
UPDATE : I found the getEvents method, but it is deprecated. However, I do not see an alternative.
source
share