Skip to content

Commit

Permalink
Server addressed the issues of empty list returned for missing keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tishun committed Jun 19, 2024
1 parent 7ff981d commit 5664939
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ void hexpire() {
assertThat(redis.hexpire(MY_KEY, 0, MY_FIELD)).containsExactly(2L);
assertThat(redis.hset(MY_KEY, MY_FIELD, MY_VALUE)).isTrue();
assertThat(redis.hexpire(MY_KEY, 1, MY_FIELD, MY_SECOND_FIELD)).containsExactly(1L, -2L);
assertThat(redis.hexpire("invalidKey", 1, MY_FIELD)).isEmpty();
assertThat(redis.hexpire("invalidKey", 1, MY_FIELD)).containsExactly(-2L);

await().until(() -> redis.hget(MY_KEY, MY_FIELD) == null);
}
Expand All @@ -584,7 +584,7 @@ void hexpireat() {
assertThat(redis.hexpireat(MY_KEY, Instant.now().minusSeconds(1), MY_FIELD)).containsExactly(2L);
assertThat(redis.hset(MY_KEY, MY_FIELD, MY_VALUE)).isTrue();
assertThat(redis.hexpireat(MY_KEY, Instant.now().plusSeconds(1), MY_FIELD)).containsExactly(1L);
assertThat(redis.hexpireat("invalidKey", Instant.now().plusSeconds(1), MY_FIELD)).isEmpty();
assertThat(redis.hexpireat("invalidKey", Instant.now().plusSeconds(1), MY_FIELD)).containsExactly(-2L);

await().until(() -> redis.hget(MY_KEY, MY_FIELD) == null);
}
Expand All @@ -609,7 +609,7 @@ void hexpiretime() {
@Test
@EnabledOnCommand("HPERSIST")
void hpersist() {
assertThat(redis.hpersist(MY_KEY, MY_FIELD)).isEmpty();
assertThat(redis.hpersist(MY_KEY, MY_FIELD)).containsExactly(-2L);

assertThat(redis.hset(MY_KEY, MY_FIELD, MY_VALUE)).isTrue();
assertThat(redis.hpersist(MY_KEY, MY_FIELD)).containsExactly(-1L);
Expand Down

0 comments on commit 5664939

Please sign in to comment.