use of com.nytimes.android.external.store3.base.impl.MemoryPolicy in project Store by NYTimes.
the class NoopPersisterTest method testReadingOfMemoryPolicies.
// https://github.com/NYTimes/Store/issues/312
@Test
public void testReadingOfMemoryPolicies() {
MemoryPolicy expireAfterWritePolicy = MemoryPolicy.builder().setExpireAfterWrite(1).setExpireAfterTimeUnit(TimeUnit.HOURS).build();
NoopPersister.create(expireAfterWritePolicy);
MemoryPolicy expireAfterAccessPolicy = MemoryPolicy.builder().setExpireAfterAccess(1).setExpireAfterTimeUnit(TimeUnit.HOURS).build();
NoopPersister.create(expireAfterAccessPolicy);
exception.expect(IllegalArgumentException.class);
exception.expectMessage("No expiry policy set");
MemoryPolicy incompletePolicy = MemoryPolicy.builder().setExpireAfterTimeUnit(TimeUnit.HOURS).build();
NoopPersister.create(incompletePolicy);
}
Aggregations