@Test public void testFilter_turnFilterOn() { TestObserver<Result> testObserver; NowPlayingInteractor nowPlayingInteractor = new NowPlayingInteractor(mockServiceController, filterTransformer); List<MovieInfo> movieInfoList = new ArrayList<MovieInfo>(); for (int i = 0; i < 5; i++) { movieInfoList.add(movieInfo); } when(mockFilterManager.isFilterOn()).thenReturn(true); when(mockFilterManager.getFullList()).thenReturn(movieInfoList); testObserver = nowPlayingInteractor.processAction( Observable.just((Action) new FilterAction(true))).test(); testScheduler.triggerActions(); testObserver.assertNoErrors(); testObserver.assertValueCount(1); Result result = (Result) testObserver.getEvents().get(0).get(0); assertThat(result).isNotNull(); assertThat(result).isInstanceOf(FilterResult.class); FilterResult filterResult = (FilterResult) result; assertThat(filterResult.getFilteredList().containsAll(movieInfoList)); assertThat(filterResult.isFilterOn()).isTrue(); assertThat(filterResult.getType()).isEqualTo(Result.ResultType.SUCCESS); }
public Observable<Result> processAction(Observable<Action> actions) { return actions.compose(transformActionIntoResults); }
NowPlayingInteractor { public Observable<Result> processAction(Observable<Action> actions) { return actions.compose(transformActionIntoResults); } }
NowPlayingInteractor { public Observable<Result> processAction(Observable<Action> actions) { return actions.compose(transformActionIntoResults); } @SuppressWarnings("checkstyle:magicnumber")  NowPlayingInteractor(@NonNull ServiceController serviceControllerIn, @NonNull FilterTransformer filterTransformerIn); }
NowPlayingInteractor { public Observable<Result> processAction(Observable<Action> actions) { return actions.compose(transformActionIntoResults); } @SuppressWarnings("checkstyle:magicnumber")  NowPlayingInteractor(@NonNull ServiceController serviceControllerIn, @NonNull FilterTransformer filterTransformerIn); Observable<Result> processAction(Observable<Action> actions); }
NowPlayingInteractor { public Observable<Result> processAction(Observable<Action> actions) { return actions.compose(transformActionIntoResults); } @SuppressWarnings("checkstyle:magicnumber")  NowPlayingInteractor(@NonNull ServiceController serviceControllerIn, @NonNull FilterTransformer filterTransformerIn); Observable<Result> processAction(Observable<Action> actions);  }