I am searching for a way to get the values returned from onNext in a subscriber so i can verify the results. TestSubscriber had a nice method called getOnNextEvent but when i use TestObserver i dont see a method like this i can use so that i can get the results to check it ? There all deprecated and when i check in the IDE there not even showing up.
Here is what i want to test:
`@Test
public void buildUseCaseObservable(){
TestObserver subscriber = TestObserver.create();
standardLoginUsecase.buildUseCaseObservable().subscribe(subscriber);
subscriber.assertNoErrors();
subscriber.assertSubscribed();
subscriber.assertComplete();
//i would like to test the actual onNext results also , but how ?
}`
UPDATE: I FOUND a getEvents method but its deprecated. i dont see any alternative though.
TestObserver<List<User>> testObserver = new TestObserver<>();
testObserver.values();
Use values method to test the onNext Items
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With