MasterBackendDvrDataStore implements DvrDataStore { @Override public Observable<List<TitleInfoEntity>> titleInfoEntityList() { Log.d( TAG, "titleInfoEntityList : enter" ); return this.api.titleInfoEntityList() .doOnError( e -> Log.e( TAG, "titleInfoEntityList : error", e ) ); } MasterBackendDvrDataStore( final DvrApi api ); @Override Observable<List<TitleInfoEntity>> titleInfoEntityList(); @Override Observable<List<ProgramEntity>> recordedProgramEntityList( final boolean descending, final int startIndex, final int count, final String titleRegEx, final String recGroup, final String storageGroup ); @Override Observable<ProgramEntity> recordedProgramEntityDetails( final int recordedId ); @Override Observable<List<ProgramEntity>> upcomingProgramEntityList( final int startIndex, final int count, final boolean showAll, final int recordId, final int recStatus ); @Override Observable<List<EncoderEntity>> encoderEntityList(); @Override Observable<Boolean> updateWatchedStatus( final int id, final boolean watched ); @Override Observable<Long> getBookmark( final int recordedId, final String offsetType );  }
@Test public void testGetTitleInfoEntityListFromApi() { Observable<List<TitleInfoEntity>> fakeTitleInfoEntityListObservable = Observable.just( Collections.emptyList() ); given( mockDvrApi.titleInfoEntityList() ).willReturn( fakeTitleInfoEntityListObservable ); masterBackendDvrDataStore.titleInfoEntityList(); verify( mockDvrApi ).titleInfoEntityList(); }