Esempio n. 1
0
  @Test
  public void initializeCache_withValidContext_shouldCreateNewCachesIdempotently()
      throws Exception {
    assertThat(CacheService.getDiskLruCache()).isNull();

    CacheService.initialize(context);
    DiskLruCache diskLruCache = CacheService.getDiskLruCache();
    assertThat(diskLruCache).isNotNull();

    CacheService.initialize(context);
    assertThat(diskLruCache).isEqualTo(CacheService.getDiskLruCache());
  }
Esempio n. 2
0
 public static void assertDiskCacheIsEmpty() {
   assertThat(CacheService.getDiskLruCache()).isNotNull();
   assertThat(CacheService.getDiskLruCache().size()).isEqualTo(0);
 }
Esempio n. 3
0
 public static void assertDiskCacheIsUninitialized() {
   assertThat(CacheService.getDiskLruCache()).isNull();
 }