Ejemplo 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());
  }
Ejemplo n.º 2
0
 public static void assertDiskCacheIsEmpty() {
   assertThat(CacheService.getDiskLruCache()).isNotNull();
   assertThat(CacheService.getDiskLruCache().size()).isEqualTo(0);
 }
Ejemplo n.º 3
0
 public static void assertDiskCacheIsUninitialized() {
   assertThat(CacheService.getDiskLruCache()).isNull();
 }