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