@Test public void checkIfItemsArePassedToView() { List<String> items = Arrays.asList("Model", "View", "Controller"); presenter.onFinished(items); verify(view, times(1)).setItems(items); verify(view, times(1)).hideProgress(); }
public void onFinished(List<String> items) { if (mainView != null) { mainView.setItems(items); mainView.hideProgress(); } }
MainPresenter { public void onFinished(List<String> items) { if (mainView != null) { mainView.setItems(items); mainView.hideProgress(); } } }
MainPresenter { public void onFinished(List<String> items) { if (mainView != null) { mainView.setItems(items); mainView.hideProgress(); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); }
MainPresenter { public void onFinished(List<String> items) { if (mainView != null) { mainView.setItems(items); mainView.hideProgress(); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); void onFinished(List<String> items); MainView getMainView(); }
MainPresenter { public void onFinished(List<String> items) { if (mainView != null) { mainView.setItems(items); mainView.hideProgress(); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); void onFinished(List<String> items); MainView getMainView();  }