Commit 654996b
committed
Fix bzPopMaxShouldWorkCorrectly() and bzPopMinShouldWorkCorrectly() tests in JedisClusterConnectionTests.
Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x):
Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null:
at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616)
This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run.
Closes spring-projects#26121 parent 1d36135 commit 654996b
File tree
1 file changed
+2
-2
lines changed- src/test/java/org/springframework/data/redis/connection/jedis
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2279 | 2279 | | |
2280 | 2280 | | |
2281 | 2281 | | |
2282 | | - | |
| 2282 | + | |
2283 | 2283 | | |
2284 | 2284 | | |
2285 | 2285 | | |
| |||
2306 | 2306 | | |
2307 | 2307 | | |
2308 | 2308 | | |
2309 | | - | |
| 2309 | + | |
2310 | 2310 | | |
2311 | 2311 | | |
2312 | 2312 | | |
| |||
0 commit comments