@Test public void testGetVideoById() { VideoMetadataInfoEntity fakeVideoMetadataInfoEntity = createVideoMetadataInfoEntity(); Observable<VideoMetadataInfoEntity> fakeObservable = Observable.just( fakeVideoMetadataInfoEntity ); given( mockVideoApi.getVideoById( FAKE_VIDEO_ID ) ).willReturn( fakeObservable ); masterBackendVideoDataStore.getVideoById(FAKE_VIDEO_ID); verify( mockVideoApi ).getVideoById( FAKE_VIDEO_ID ); }
@Override public Observable<VideoMetadataInfoEntity> getVideoById( int id ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : id=" + id ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoById( id ) .doOnNext( entity -> Log.i( TAG, "getVideoById : entity=" + entity ) ); }
MasterBackendVideoDataStore implements VideoDataStore { @Override public Observable<VideoMetadataInfoEntity> getVideoById( int id ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : id=" + id ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoById( id ) .doOnNext( entity -> Log.i( TAG, "getVideoById : entity=" + entity ) ); } }
MasterBackendVideoDataStore implements VideoDataStore { @Override public Observable<VideoMetadataInfoEntity> getVideoById( int id ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : id=" + id ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoById( id ) .doOnNext( entity -> Log.i( TAG, "getVideoById : entity=" + entity ) ); } MasterBackendVideoDataStore( VideoApi api ); }
MasterBackendVideoDataStore implements VideoDataStore { @Override public Observable<VideoMetadataInfoEntity> getVideoById( int id ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : id=" + id ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoById( id ) .doOnNext( entity -> Log.i( TAG, "getVideoById : entity=" + entity ) ); } MasterBackendVideoDataStore( VideoApi api ); @Override Observable<List<VideoMetadataInfoEntity>> getVideos( String folder, String sort, boolean descending, int startIndex, int count ); @Override Observable<List<VideoMetadataInfoEntity>> getCategory( final String category ); @Override Observable<List<VideoMetadataInfoEntity>> getSeriesInCategory( String category, String series ); @Override Observable<VideoMetadataInfoEntity> getVideoById( int id ); @Override Observable<VideoMetadataInfoEntity> getVideoByFilename( String filename ); @Override Observable<Boolean> updateWatchedStatus( final int videoId, final boolean watched ); }
MasterBackendVideoDataStore implements VideoDataStore { @Override public Observable<VideoMetadataInfoEntity> getVideoById( int id ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : id=" + id ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoById( id ) .doOnNext( entity -> Log.i( TAG, "getVideoById : entity=" + entity ) ); } MasterBackendVideoDataStore( VideoApi api ); @Override Observable<List<VideoMetadataInfoEntity>> getVideos( String folder, String sort, boolean descending, int startIndex, int count ); @Override Observable<List<VideoMetadataInfoEntity>> getCategory( final String category ); @Override Observable<List<VideoMetadataInfoEntity>> getSeriesInCategory( String category, String series ); @Override Observable<VideoMetadataInfoEntity> getVideoById( int id ); @Override Observable<VideoMetadataInfoEntity> getVideoByFilename( String filename ); @Override Observable<Boolean> updateWatchedStatus( final int videoId, final boolean watched );  }