MasterBackendVideoDataStore implements VideoDataStore { @Override public Observable<VideoMetadataInfoEntity> getVideoByFilename( String filename ) { Log.d( TAG, "getVideoById : enter" ); Log.d( TAG, "getVideoById : filename=" + filename ); Log.d( TAG, "getVideoById : exit" ); return this.api.getVideoByFilename( filename ); } 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 );  }
@Test public void testGetVideoByFilename() { VideoMetadataInfoEntity fakeVideoMetadataInfoEntity = createVideoMetadataInfoEntity(); Observable<VideoMetadataInfoEntity> fakeObservable = Observable.just( fakeVideoMetadataInfoEntity ); given( mockVideoApi.getVideoByFilename( FAKE_VIDEO_FILENAME ) ).willReturn( fakeObservable ); masterBackendVideoDataStore.getVideoByFilename( FAKE_VIDEO_FILENAME ); verify( mockVideoApi ).getVideoByFilename( FAKE_VIDEO_FILENAME ); }