DATAREDIS-588 - Polishing.

Simplify SET command usage with Jedis using various expiry and presence/absence flags to use consistently SetParams.

Original Pull Request: #463
This commit is contained in:
Mark Paluch
2019-06-28 13:21:51 +02:00
committed by Christoph Strobl
parent f6e05740ff
commit 15fd1d38de
4 changed files with 31 additions and 107 deletions

View File

@@ -1830,11 +1830,15 @@ public class JedisClusterConnectionTests implements ClusterConnectionTests {
assertThat(nativeConnection.ttl(KEY_1_BYTES)).isEqualTo(-1L);
}
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-316
@Test // DATAREDIS-316, DATAREDIS-588
public void setWithOptionIfPresentShouldWorkCorrectly() {
nativeConnection.set(KEY_1_BYTES, VALUE_1_BYTES);
clusterConnection.set(KEY_1_BYTES, VALUE_2_BYTES, Expiration.persistent(), SetOption.ifPresent());
assertThat(nativeConnection.exists(KEY_1_BYTES), is(true));
assertThat(clusterConnection.get(KEY_1_BYTES), is(VALUE_2_BYTES));
assertThat(nativeConnection.ttl(KEY_1_BYTES), is(-1L));
}
@Test // DATAREDIS-315