Fixed - RJsonBucket.delete() method doesn't work. #4386

pull/4428/head
Nikita Koksharov 3 years ago
parent d5c4e1d031
commit 5bb53a4c4a

@ -431,7 +431,7 @@ public class RedissonJsonBucket<V> extends RedissonExpirable implements RJsonBuc
@Override
public RFuture<Boolean> deleteAsync() {
return commandExecutor.writeAsync(getRawName(), StringCodec.INSTANCE, RedisCommands.JSON_DEL, getRawName());
return commandExecutor.writeAsync(getRawName(), StringCodec.INSTANCE, RedisCommands.JSON_DEL_BOOLEAN, getRawName());
}
@Override

@ -734,6 +734,8 @@ public interface RedisCommands {
RedisStrictCommand<Long> JSON_DEL_LONG = new RedisStrictCommand<>("JSON.DEL");
RedisStrictCommand<Boolean> JSON_DEL_BOOLEAN = new RedisStrictCommand<>("JSON.DEL", new BooleanReplayConvertor());
RedisStrictCommand<Void> JSON_SET = new RedisStrictCommand<>("JSON.SET", new VoidReplayConvertor());
RedisStrictCommand<Boolean> JSON_SET_BOOLEAN = new RedisStrictCommand<>("JSON.SET", new BooleanNotNullReplayConvertor());
}

@ -415,6 +415,16 @@ public class RedissonJsonBucketTest extends BaseTest {
assertThat(n2).isEqualTo(123);
}
@Test
public void testDelete() {
RJsonBucket<TestType> al = redisson.getJsonBucket("test", new JacksonCodec<>(TestType.class));
assertThat(al.delete()).isFalse();
TestType t = new TestType();
t.setName("name1");
al.set(t);
assertThat(al.delete()).isTrue();
}
@Test
public void testSetGet() {
RJsonBucket<TestType> al = redisson.getJsonBucket("test", new JacksonCodec<>(TestType.class));

Loading…
Cancel
Save