|
99 | 99 | * @author Thomas Darimont
|
100 | 100 | * @author Mark Paluch
|
101 | 101 | * @author Tugdual Grall
|
| 102 | + * @author Dejan Jankov |
102 | 103 | */
|
103 | 104 | @ProfileValueSourceConfiguration(RedisTestProfileValueSource.class)
|
104 | 105 | public abstract class AbstractConnectionIntegrationTests {
|
@@ -3125,6 +3126,28 @@ public void xRevRangeShouldReportMessages() {
|
3125 | 3126 | assertThat(messages.get(1).getValue()).isEqualTo(Collections.singletonMap(KEY_2, VALUE_2));
|
3126 | 3127 | }
|
3127 | 3128 |
|
| 3129 | + @Test // DATAREDIS-1207 |
| 3130 | + @IfProfileValue(name = "redisVersion", value = "5.0") |
| 3131 | + @WithRedisDriver({ RedisDriver.LETTUCE }) |
| 3132 | + public void xRevRangeShouldWorkWithBoundedRange() { |
| 3133 | + |
| 3134 | + actual.add(connection.xAdd(KEY_1, Collections.singletonMap(KEY_2, VALUE_2))); |
| 3135 | + actual.add(connection.xAdd(KEY_1, Collections.singletonMap(KEY_3, VALUE_3))); |
| 3136 | + actual.add(connection.xRevRange(KEY_1, org.springframework.data.domain.Range.closed("0-0", "+"))); |
| 3137 | + |
| 3138 | + List<Object> results = getResults(); |
| 3139 | + assertThat(results).hasSize(3); |
| 3140 | + |
| 3141 | + List<MapRecord<String, String, String>> messages = (List) results.get(2); |
| 3142 | + assertThat(messages).hasSize(2); |
| 3143 | + |
| 3144 | + assertThat(messages.get(0).getStream()).isEqualTo(KEY_1); |
| 3145 | + assertThat(messages.get(0).getValue()).isEqualTo(Collections.singletonMap(KEY_3, VALUE_3)); |
| 3146 | + |
| 3147 | + assertThat(messages.get(1).getStream()).isEqualTo(KEY_1); |
| 3148 | + assertThat(messages.get(1).getValue()).isEqualTo(Collections.singletonMap(KEY_2, VALUE_2)); |
| 3149 | + } |
| 3150 | + |
3128 | 3151 | @Test // DATAREDIS-1084
|
3129 | 3152 | @IfProfileValue(name = "redisVersion", value = "5.0")
|
3130 | 3153 | @WithRedisDriver({ RedisDriver.LETTUCE })
|
|
0 commit comments