Skip to content

Commit

Permalink
address more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe Yip authored and Chloe Yip committed Jun 19, 2024
1 parent 88cc742 commit 7331c08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public interface StringBaseCommands {
* @since Redis 6.2.0.
* @see <a href="https://redis.io/docs/latest/commands/getex/">redis.io</a> for details.
* @param key The <code>key</code> to retrieve from the database.
* @param options The GetEx options.
* @param options The {@link GetExOptions} options.
* @return If <code>key</code> exists, return the value of the <code>key</code>. Otherwise, return
* <code>null</code>.
* @example
Expand Down
18 changes: 14 additions & 4 deletions java/integTest/src/test/java/glide/TransactionTestUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ private static Object[] stringCommands(BaseTransaction<?> transaction) {
transaction
.set(stringKey1, value1)
.get(stringKey1)
.getex(stringKey1)
.getex(stringKey1, GetExOptions.Seconds(20L))
.getdel(stringKey1)
.set(stringKey2, value2, SetOptions.builder().returnOldValue(true).build())
.strlen(stringKey2)
Expand All @@ -232,6 +230,10 @@ private static Object[] stringCommands(BaseTransaction<?> transaction) {
.msetnx(Map.of(stringKey4, "foo", stringKey5, "bar"))
.mget(new String[] {stringKey4, stringKey5});

if (REDIS_VERSION.isGreaterThanOrEqualTo("6.2.0")) {
transaction.getex(stringKey1).getex(stringKey1, GetExOptions.Seconds(20L));
}

if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
transaction
.set(stringKey6, "abcd")
Expand All @@ -247,8 +249,6 @@ private static Object[] stringCommands(BaseTransaction<?> transaction) {
new Object[] {
OK, // set(stringKey1, value1)
value1, // get(stringKey1)
value1, // getex(stringKey1)
value1, // getex(stringKey1,GetExOptions.Seconds(20L))
value1, // getdel(stringKey1)
null, // set(stringKey2, value2, returnOldValue(true))
(long) value1.length(), // strlen(key2)
Expand All @@ -269,6 +269,16 @@ private static Object[] stringCommands(BaseTransaction<?> transaction) {
new String[] {"foo", null}, // mget({stringKey4, stringKey5})
};

if (REDIS_VERSION.isGreaterThanOrEqualTo("6.2.0")) {
expectedResults =
concatenateArrays(
expectedResults,
new Object[] {
value1, // getex(stringKey1)
value1, // getex(stringKey1,GetExOptions.Seconds(20L))
});
}

if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
expectedResults =
concatenateArrays(
Expand Down

0 comments on commit 7331c08

Please sign in to comment.