@Test public void getMovieDetails() { Movie movie = mMovieList.get(1); when(apiService.getMovieDetails(MOVIE_ID, API_KEY)).thenReturn(Observable.just(movie)); mRemoteRepository.getMovieDetails(MOVIE_ID).subscribeWith(mMovieTestSubscriber); verify(apiService).getMovieDetails(MOVIE_ID, API_KEY); mMovieTestSubscriber.assertValue(movie); }
@Override public Observable<Movie> getMovieDetails(long movieId) { return apiService.getMovieDetails(movieId, ApiUtils.getApiKey()); }
MoviesRemoteRepository implements MoviesRepository { @Override public Observable<Movie> getMovieDetails(long movieId) { return apiService.getMovieDetails(movieId, ApiUtils.getApiKey()); } }
MoviesRemoteRepository implements MoviesRepository { @Override public Observable<Movie> getMovieDetails(long movieId) { return apiService.getMovieDetails(movieId, ApiUtils.getApiKey()); } MoviesRemoteRepository(MovieApiService apiService); }
MoviesRemoteRepository implements MoviesRepository { @Override public Observable<Movie> getMovieDetails(long movieId) { return apiService.getMovieDetails(movieId, ApiUtils.getApiKey()); } MoviesRemoteRepository(MovieApiService apiService); @Override Observable<List<Movie>> getPopularMovies(int page); @Override Observable<Movie> getMovieDetails(long movieId); }
MoviesRemoteRepository implements MoviesRepository { @Override public Observable<Movie> getMovieDetails(long movieId) { return apiService.getMovieDetails(movieId, ApiUtils.getApiKey()); } MoviesRemoteRepository(MovieApiService apiService); @Override Observable<List<Movie>> getPopularMovies(int page); @Override Observable<Movie> getMovieDetails(long movieId);  }