diff --git a/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java b/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java index 69cd383c1..3e5fce8a7 100644 --- a/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java +++ b/src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java @@ -224,12 +224,30 @@ public class RedisCacheTests { doWithConnection(connection -> { connection.set(binaryCacheKey, binaryNullValue); + connection.set("other".getBytes(), "value".getBytes()); }); cache.evict(key); doWithConnection(connection -> { assertThat(connection.exists(binaryCacheKey)).isFalse(); + assertThat(connection.exists("other".getBytes())).isTrue(); + }); + } + + @ParameterizedRedisTest // GH-2028 + void clearShouldClearCache() { + + doWithConnection(connection -> { + connection.set(binaryCacheKey, binaryNullValue); + connection.set("other".getBytes(), "value".getBytes()); + }); + + cache.clear(); + + doWithConnection(connection -> { + assertThat(connection.exists(binaryCacheKey)).isFalse(); + assertThat(connection.exists("other".getBytes())).isTrue(); }); }