RepositoriesPresenter extends BasePresenter<RepositoriesView> { @Override protected void onFirstViewAttach() { super.onFirstViewAttach(); loadRepositories(false); } RepositoriesPresenter(); void loadNextRepositories(int currentCount); void loadRepositories(boolean isRefreshing); void onErrorCancel();  }
@Test public void repositories_shouldOnAttachLoadAndShowRepositores() { List<Repository> repositories = repositores(); when(githubService.getUserRepos(anyString(), anyInt(), anyInt())).thenReturn(Observable.just(repositories)); presenter.onFirstViewAttach(); verify(repositoriesViewState).onStartLoading(); verify(repositoriesViewState, never()).showRefreshing(); verify(repositoriesViewState).showListProgress(); verify(repositoriesViewState).onFinishLoading(); verify(repositoriesViewState).setRepositories(repositories, false); }