DATAREDIS-542 - Polishing.

Prevent putIfAbsent from prolonging expiration time of existing keys having same value.
Remove some trailing white spaces.

Original Pull Request: #224
This commit is contained in:
Christoph Strobl
2016-10-07 09:07:28 +02:00
parent ea598c2dad
commit 72d6df00c8
2 changed files with 18 additions and 27 deletions

View File

@@ -197,7 +197,7 @@ public class RedisCacheUnitTests {
* @see DATAREDIS-542
*/
@Test
public void putIfAbsentShouldExpireWhenValueWasNotSetAndRedisContainsSameData() {
public void putIfAbsentShouldNotSetExpireWhenValueWasNotSetAndRedisContainsSameData() {
when(connectionMock.setNX(KEY_BYTES, VALUE_BYTES)).thenReturn(false);
when(connectionMock.get(KEY_BYTES)).thenReturn(VALUE_BYTES);
@@ -206,7 +206,7 @@ public class RedisCacheUnitTests {
Cache.ValueWrapper valueWrapper = cache.putIfAbsent(KEY, VALUE);
assertThat(valueWrapper, is(notNullValue()));
verify(connectionMock).expire(eq(KEY_BYTES), anyLong());
verify(connectionMock, never()).expire(eq(KEY_BYTES), anyLong());
}
/**