@Test public void testGetEncodersHappyCase() { List<EncoderEntity> encodersList = new ArrayList<>(); encodersList.add( EncoderEntity.create( -1, "", false, false, -1, -1, false, Collections.emptyList(), createFakeProgramEntity() ) ); given( mockDvrDataStore.encoderEntityList() ).willReturn( Observable.just( encodersList ) ); dvrDataRepository.encoders(); verify( mockDvrDataStoreFactory ).createMasterBackendDataStore(); verify( mockDvrDataStore ).encoderEntityList(); }
@SuppressWarnings( CONVERT2METHODREF ) @Override public Observable<List<Encoder>> encoders() { Log.d( TAG, "encoders : enter" ); final DvrDataStore dvrDataStore = this.dvrDataStoreFactory.createMasterBackendDataStore(); return dvrDataStore.encoderEntityList() .doOnError( throwable -> Log.e( TAG, "encoders : error", throwable ) ) .map( encoderEntities -> EncoderEntityDataMapper.transformCollection( encoderEntities ) ); }
DvrDataRepository implements DvrRepository { @SuppressWarnings( CONVERT2METHODREF ) @Override public Observable<List<Encoder>> encoders() { Log.d( TAG, "encoders : enter" ); final DvrDataStore dvrDataStore = this.dvrDataStoreFactory.createMasterBackendDataStore(); return dvrDataStore.encoderEntityList() .doOnError( throwable -> Log.e( TAG, "encoders : error", throwable ) ) .map( encoderEntities -> EncoderEntityDataMapper.transformCollection( encoderEntities ) ); } }
DvrDataRepository implements DvrRepository { @SuppressWarnings( CONVERT2METHODREF ) @Override public Observable<List<Encoder>> encoders() { Log.d( TAG, "encoders : enter" ); final DvrDataStore dvrDataStore = this.dvrDataStoreFactory.createMasterBackendDataStore(); return dvrDataStore.encoderEntityList() .doOnError( throwable -> Log.e( TAG, "encoders : error", throwable ) ) .map( encoderEntities -> EncoderEntityDataMapper.transformCollection( encoderEntities ) ); } @Inject  DvrDataRepository( DvrDataStoreFactory dvrDataStoreFactory ); }
DvrDataRepository implements DvrRepository { @SuppressWarnings( CONVERT2METHODREF ) @Override public Observable<List<Encoder>> encoders() { Log.d( TAG, "encoders : enter" ); final DvrDataStore dvrDataStore = this.dvrDataStoreFactory.createMasterBackendDataStore(); return dvrDataStore.encoderEntityList() .doOnError( throwable -> Log.e( TAG, "encoders : error", throwable ) ) .map( encoderEntities -> EncoderEntityDataMapper.transformCollection( encoderEntities ) ); } @Inject  DvrDataRepository( DvrDataStoreFactory dvrDataStoreFactory ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<Encoder>> encoders(); }
DvrDataRepository implements DvrRepository { @SuppressWarnings( CONVERT2METHODREF ) @Override public Observable<List<Encoder>> encoders() { Log.d( TAG, "encoders : enter" ); final DvrDataStore dvrDataStore = this.dvrDataStoreFactory.createMasterBackendDataStore(); return dvrDataStore.encoderEntityList() .doOnError( throwable -> Log.e( TAG, "encoders : error", throwable ) ) .map( encoderEntities -> EncoderEntityDataMapper.transformCollection( encoderEntities ) ); } @Inject  DvrDataRepository( DvrDataStoreFactory dvrDataStoreFactory ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<Encoder>> encoders();  }