@Test public void whenSetCacheValidityThenInvokeCachedDataSource() { sut.setCacheValidity(CACHE_VALIDITY_2); verify(cacheDataSource).setCacheValidity(CACHE_VALIDITY_2); }
@SuppressWarnings("WeakerAccess") public void setCacheValidity(Long newCacheValidity) { cacheDataSource.setCacheValidity(newCacheValidity); }
SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> { @SuppressWarnings("WeakerAccess") public void setCacheValidity(Long newCacheValidity) { cacheDataSource.setCacheValidity(newCacheValidity); } }
SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> { @SuppressWarnings("WeakerAccess") public void setCacheValidity(Long newCacheValidity) { cacheDataSource.setCacheValidity(newCacheValidity); } SingleLevelCacheRepository(@NotNull DataSource<M, P> networkDataSource, @NotNull MemoryCacheDataSource<M, P> cacheDataSource); }
SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> { @SuppressWarnings("WeakerAccess") public void setCacheValidity(Long newCacheValidity) { cacheDataSource.setCacheValidity(newCacheValidity); } SingleLevelCacheRepository(@NotNull DataSource<M, P> networkDataSource, @NotNull MemoryCacheDataSource<M, P> cacheDataSource); @NotNull @Override Single<M> get(P params); @NotNull @Override Single<M> getLatest(P params); @SuppressWarnings("WeakerAccess") void setCacheValidity(Long newCacheValidity); void invalidateCache(); }
SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> { @SuppressWarnings("WeakerAccess") public void setCacheValidity(Long newCacheValidity) { cacheDataSource.setCacheValidity(newCacheValidity); } SingleLevelCacheRepository(@NotNull DataSource<M, P> networkDataSource, @NotNull MemoryCacheDataSource<M, P> cacheDataSource); @NotNull @Override Single<M> get(P params); @NotNull @Override Single<M> getLatest(P params); @SuppressWarnings("WeakerAccess") void setCacheValidity(Long newCacheValidity); void invalidateCache();  }