@Test public void checkIfShowsMessageOnItemClick() { presenter.onItemClicked(1); verify(view, times(1)).showMessage(anyString()); }
void onItemClicked(String item) { if (mainView != null) { mainView.showMessage(String.format("%s clicked", item)); } }
MainPresenter { void onItemClicked(String item) { if (mainView != null) { mainView.showMessage(String.format("%s clicked", item)); } } }
MainPresenter { void onItemClicked(String item) { if (mainView != null) { mainView.showMessage(String.format("%s clicked", item)); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); }
MainPresenter { void onItemClicked(String item) { if (mainView != null) { mainView.showMessage(String.format("%s clicked", item)); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); void onFinished(List<String> items); MainView getMainView(); }
MainPresenter { void onItemClicked(String item) { if (mainView != null) { mainView.showMessage(String.format("%s clicked", item)); } } MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor); void onFinished(List<String> items); MainView getMainView();  }