Fix RList remove with count response

Signed-off-by: Carter McCardwell <carter.mccardwell@airbnb.com>
pull/3977/head
Carter McCardwell 3 years ago
parent ba98b14dd6
commit 37c3a3adbd

@ -136,7 +136,7 @@ public class RedissonList<V> extends RedissonExpirable implements RList<V> {
@Override
public RFuture<Boolean> removeAsync(Object o, int count) {
return commandExecutor.writeAsync(getRawName(), codec, LREM_SINGLE, getRawName(), count, encode(o));
return commandExecutor.writeAsync(getRawName(), codec, LREM, getRawName(), count, encode(o));
}
@Override

@ -172,7 +172,7 @@ public interface RedisCommands {
RedisCommand<Void> LSET = new RedisCommand<Void>("LSET", new VoidReplayConvertor());
RedisCommand<Object> LPOP = new RedisCommand<Object>("LPOP");
RedisCommand<List<Object>> LPOP_LIST = new RedisCommand<>("LPOP", new ObjectListReplayDecoder<>());
RedisCommand<Boolean> LREM_SINGLE = new RedisCommand<Boolean>("LREM", new BooleanReplayConvertor());
RedisCommand<Boolean> LREM = new RedisCommand<Boolean>("LREM", new BooleanAmountReplayConvertor());
RedisCommand<Object> LINDEX = new RedisCommand<Object>("LINDEX");
RedisCommand<Object> LMOVE = new RedisCommand<Object>("LMOVE");
RedisCommand<Integer> LINSERT_INT = new RedisCommand<Integer>("LINSERT", new IntegerReplayConvertor());

@ -905,6 +905,22 @@ public class RedissonListTest extends BaseTest {
assertThat(list).containsExactly(2, 3, 5);
}
@Test
public void testRemoveWithCount() {
RList<Integer> list = redisson.getList("list");
list.add(1);
list.add(2);
list.add(3);
list.add(3);
list.add(4);
assertThat(list.remove(1, 5)).isTrue();
assertThat(list).containsExactly(2, 3, 3, 4);
assertThat(list.remove(3, 5)).isTrue();
assertThat(list).containsExactly(2, 4);
}
@Test
public void testSubListRemove() {
List<Integer> list = redisson.getList("list");

Loading…
Cancel
Save