Skip to content

Commit 1da9bf6

Browse files
committed
Enable Redis Cache TTI expiration integration tests iff GETEX command is available.
The Redis GETEX command is only available when the Redis server version is at least 6.2.0. Closes spring-projects#2351
1 parent 20d8ea6 commit 1da9bf6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/java/org/springframework/data/redis/cache/RedisCacheTests.java

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
4949
import org.springframework.data.redis.serializer.RedisSerializationContext.SerializationPair;
5050
import org.springframework.data.redis.serializer.RedisSerializer;
51+
import org.springframework.data.redis.test.condition.EnabledOnCommand;
5152
import org.springframework.data.redis.test.extension.parametrized.MethodSource;
5253
import org.springframework.data.redis.test.extension.parametrized.ParameterizedRedisTest;
5354
import org.springframework.lang.Nullable;
@@ -549,6 +550,7 @@ public CacheStatistics getCacheStatistics(String cacheName) {
549550
assertThat(retrievals).hasValue(1);
550551
}
551552

553+
@EnabledOnCommand("GETEX")
552554
@ParameterizedRedisTest // GH-2351
553555
void cacheGetWithTimeToIdleExpirationWhenEntryNotExpiredShouldReturnValue() {
554556

@@ -565,6 +567,7 @@ void cacheGetWithTimeToIdleExpirationWhenEntryNotExpiredShouldReturnValue() {
565567
}
566568
}
567569

570+
@EnabledOnCommand("GETEX")
568571
@ParameterizedRedisTest // GH-2351
569572
void cacheGetWithTimeToIdleExpirationAfterEntryExpiresShouldReturnNull() {
570573

0 commit comments

Comments
 (0)