@Test public void settingsSatisfied_1Location() { Location loc = Mockito.mock(Location.class); Address address = Mockito.mock(Address.class); doReturn(Single.just(true)).when(locationSettings).checkAndHandleResolution(Matchers.any(LocationRequest.class)); doReturn(Observable.just(loc)).when(fusedLocation).updates(Matchers.any(LocationRequest.class)); doReturn(Maybe.just(address)).when(geocoding).fromLocation(Matchers.any(android.location.Location.class)); mainPresenter.attachView(mainView); verify(mainView).onLocationUpdate(loc); verify(mainView).onAddressUpdate(address); verifyNoMoreInteractions(mainView); }
public void attachView(MainView view) { this.view = view; startLocationRefresh(); }
MainPresenter { public void attachView(MainView view) { this.view = view; startLocationRefresh(); } }
MainPresenter { public void attachView(MainView view) { this.view = view; startLocationRefresh(); } MainPresenter(RxLocation rxLocation); }
MainPresenter { public void attachView(MainView view) { this.view = view; startLocationRefresh(); } MainPresenter(RxLocation rxLocation); void attachView(MainView view); void detachView(); void startLocationRefresh(); }
MainPresenter { public void attachView(MainView view) { this.view = view; startLocationRefresh(); } MainPresenter(RxLocation rxLocation); void attachView(MainView view); void detachView(); void startLocationRefresh();  }