MovieListPresenter extends BasePresenterImpl<MovieListContract.View> implements MovieListContract.Presenter { @Override public void start() { loadMovies(getView().getSearchQuery(), null, new ListLoadType(ListLoadType.FIRST)); } MovieListPresenter(@NonNull MovieListContract.View view,
            @NonNull TmdbApi api, @NonNull AppSettings appSettings); @Override void start(); @Override void openSortOrderSelector(); @Override void openMovieDetails(@NonNull Movie movie, @NonNull MovieListItemBinding B); @Override void setSortOrder(@NonNull SortOrder sortOrder); @Override void startSwipeRefresh(); @Override void startNextPageLoad(Integer page);  }
@Test public void startPresenterWithPopularSortOrder() { when(appSettings.getSortOrder()).thenReturn(new SortOrder(SortOrder.POPULAR)); MovieListApiResponse popularMovies = MockResponse.getPopularMovies(gson); when(api.popular(null)) .thenReturn(Single.just(popularMovies)); presenter.start(); verify(api).popular(null); verify(view).showLoading(); }
@Test public void startPresenterWithTopRatedSortOrder() { when(appSettings.getSortOrder()).thenReturn(new SortOrder(SortOrder.TOP_RATED)); MovieListApiResponse topRatedMovies = MockResponse.getTopRatedMovies(gson); when(api.topRated(null)) .thenReturn(Single.just(topRatedMovies)); presenter.start(); verify(api).topRated(null); verify(view).showLoading(); }