android - How correctly test if subscriber is called with correct data in onNext() (RxJava2) -
i test method: void updateavailablescreens() { safiecam.availablecameras() .flatmap(this::getavailablescreensforcameras) // causing failure .observeon(schedulers.mainthread()) .subscribe( screens -> { view.setavailablepagesonviewpager(screens); view.setavailablepagesonbottomsheet(screens); }, timber::e ); } with test (so giving known data, expect calling view expected enum list): @test public void widgetsshouldgetallscreens() { when(camera.availablecameras()).thenreturn( observable.just(arrays.aslist( safiecam.cameratype.selfie, safiecam.cameratype.rear))); testedvppresenter.updateavailablescreens(); list<viewpagerview.pages> pages = arrays.aslist( viewpagerview.pages.selfie, vie...