MainPresenter extends BasePresenter<MainPresenter.View> implements SyncConnectionListener { void onRetryButtonClicked(boolean internetConnected) { if (!internetConnected){ getView().showNetworkError(); } else { getView().hideNetworkError(); } } @Inject  MainPresenter(); @Override void initialize(); @Override void onDestroy(); @Override void onNetworkConnectionChanged(boolean internetConnected); void onFABScrollUpClicked(); void onTabSelected(int position);  }
@Test public void shouldShowErrorIfInternetNotConnectedWhenRetryButtonClicked(){ presenter.setView(view); presenter.onRetryButtonClicked(false); verify(view , times(1)).showNetworkError(); }