DATAREDIS-402 - RedisCache should not expire known keys in case ttl of element is not set.
We now skip defining expire on known keys set in case element is eternal. Original pull request: #141.
This commit is contained in:
committed by
Thomas Darimont
parent
281c9c58ae
commit
aa04e73dbd
@@ -129,4 +129,16 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).eval(any(byte[].class), eq(ReturnType.INTEGER), eq(0),
|
||||
eq((PREFIX + "*").getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-402
|
||||
*/
|
||||
@Test
|
||||
public void putShouldNotExpireKnownKeysSetWhenTtlIsZero() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, NO_PREFIX_BYTES, templateSpy, 0L);
|
||||
cache.put(KEY, VALUE);
|
||||
|
||||
verify(connectionMock, never()).expire(eq(KNOWN_KEYS_SET_NAME_BYTES), anyLong());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user