@Test
public void fetchAllMovies_200OkResponse_InvokesCorrectApiCalls() {

    //Given
    when(mMovieDbRestService.fetchAllMovies(anyString()))
            .thenReturn(Observable.just(moviesList()));
    //When
    TestSubscriber<List<Movie>> testSubscriber = new TestSubscriber<>();
    mMovieRepository.fetchMovies(POPULAR).subscribe(testSubscriber);
    //Then
    testSubscriber.awaitTerminalEvent();
    testSubscriber.assertNoErrors();
    List<List<Movie>> onNextEvents = testSubscriber.getOnNextEvents();
    List<Movie> movies = onNextEvents.get(0);
    Assert.assertEquals(JURASIC_WORLD, movies.get(0).getOriginalTitle());
    Assert.assertEquals(FAST_AND_FURIOUS, movies.get(1).getOriginalTitle());
    verify(mMovieDbRestService).fetchAllMovies(POPULAR);
}