@Test
public void testAlbumFetching1NoPreferDownloadGetsLocalArtWhenOffline() throws IOException {

    /*
    hasAlbumArtist = true;
    hasUri = true;
    isOnline = false
    wantAlbumArt = true;
    preferDownload = false;
    isLocalArt = true;
     */
    ArtInfo artInfo = ArtInfo.forAlbum("alvvays", "alvvays", Uri.parse("content://test/art.jpg"));
    //no to wifi
    when(mPreferences.getBoolean(ArtworkPreferences.ONLY_ON_WIFI, true)).thenReturn(false);
    //not connected
    NetworkInfo networkInfo = mock(NetworkInfo.class);
    when(networkInfo.isConnectedOrConnecting()).thenReturn(false);
    when(mConnectivityManager.getActiveNetworkInfo()).thenReturn(networkInfo);
    //no to cache
    when(mL2Cache.containsKey(artInfo.cacheKey())).thenReturn(false);
    //yes to want
    when(mPreferences.getBoolean(ArtworkPreferences.DOWNLOAD_MISSING_ARTWORK, true)).thenReturn(true);
    //no to download
    when(mPreferences.getBoolean(ArtworkPreferences.PREFER_DOWNLOAD_ARTWORK, false)).thenReturn(false);
    final ContentResolver contentResolver = mock(ContentResolver.class);
    when(contentResolver.openInputStream(Uri.parse("content://test/art.jpg"))).thenReturn(
            getClass().getClassLoader().getResourceAsStream("alvvays_alvvays_thumb.jpg"));
    when(mContext.getContentResolver()).thenReturn(contentResolver);
    mFetcher.fetch(artInfo, mListener);
    verify(mListener).onNext(Matchers.<Bitmap>any());
    verify(mListener).onCompleted();
    verify(mListener, never()).onError(Matchers.<Throwable>any());
    assertThat(mFetcher.originalUri).isNullOrEmpty();
    verify(mContext).getContentResolver();
}