@Test public void testRemoveLiveStreamHappyCase() { TestSubscriber<Object> subscriber = new TestSubscriber<>(); given( mockMediaItemDataStore.removeLiveStream( any( Media.class ), anyInt() ) ).willReturn( Observable.just( mediaItemEntity() ) ); mediaItemDataRepository.removeLiveStream( FAKE_MEDIA, FAKE_ID ) .subscribe( subscriber ); assertThat( subscriber.getOnNextEvents() ) .isNotNull() .hasSize( 1 ); verify( mockMediaItemDataStoreFactory, times( 1 ) ).createMasterBackendDataStore(); verify( mockMediaItemDataStoreFactory, times( 0 ) ).create( anyInt() ); verify( mockMediaItemDataStore ).removeLiveStream( any( Media.class ), anyInt() ); }
@Override public Observable<MediaItem> removeLiveStream( final Media media, final int id ) { MediaItemDataStore mediaItemDataStore = mediaItemDataStoreFactory.createMasterBackendDataStore(); return mediaItemDataStore.removeLiveStream( media, id ) .map( MediaItemDataMapper::transform ); }
MediaItemDataRepository implements MediaItemRepository { @Override public Observable<MediaItem> removeLiveStream( final Media media, final int id ) { MediaItemDataStore mediaItemDataStore = mediaItemDataStoreFactory.createMasterBackendDataStore(); return mediaItemDataStore.removeLiveStream( media, id ) .map( MediaItemDataMapper::transform ); } }
MediaItemDataRepository implements MediaItemRepository { @Override public Observable<MediaItem> removeLiveStream( final Media media, final int id ) { MediaItemDataStore mediaItemDataStore = mediaItemDataStoreFactory.createMasterBackendDataStore(); return mediaItemDataStore.removeLiveStream( media, id ) .map( MediaItemDataMapper::transform ); } @Inject  MediaItemDataRepository(
            final MediaItemDataStoreFactory mediaItemDataStoreFactory
    ); }
MediaItemDataRepository implements MediaItemRepository { @Override public Observable<MediaItem> removeLiveStream( final Media media, final int id ) { MediaItemDataStore mediaItemDataStore = mediaItemDataStoreFactory.createMasterBackendDataStore(); return mediaItemDataStore.removeLiveStream( media, id ) .map( MediaItemDataMapper::transform ); } @Inject  MediaItemDataRepository(
            final MediaItemDataStoreFactory mediaItemDataStoreFactory
    ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<Series>> series( Media media ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<MediaItem>> mediaItems( final Media media, @Nullable final String title ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<MediaItem> mediaItem( final Media media, final int id ); @Override Observable<MediaItem> addLiveStream( final Media media, final int id ); @Override Observable<MediaItem> removeLiveStream( final Media media, final int id ); @Override Observable<MediaItem> updateWatchedStatus( Media media, int id, boolean watched ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<MediaItem>> search( String searchString ); }
MediaItemDataRepository implements MediaItemRepository { @Override public Observable<MediaItem> removeLiveStream( final Media media, final int id ) { MediaItemDataStore mediaItemDataStore = mediaItemDataStoreFactory.createMasterBackendDataStore(); return mediaItemDataStore.removeLiveStream( media, id ) .map( MediaItemDataMapper::transform ); } @Inject  MediaItemDataRepository(
            final MediaItemDataStoreFactory mediaItemDataStoreFactory
    ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<Series>> series( Media media ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<MediaItem>> mediaItems( final Media media, @Nullable final String title ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<MediaItem> mediaItem( final Media media, final int id ); @Override Observable<MediaItem> addLiveStream( final Media media, final int id ); @Override Observable<MediaItem> removeLiveStream( final Media media, final int id ); @Override Observable<MediaItem> updateWatchedStatus( Media media, int id, boolean watched ); @SuppressWarnings( CONVERT2METHODREF ) @Override Observable<List<MediaItem>> search( String searchString );  }