diff --git a/src/test/java/org/springframework/data/redis/TestCondition.java b/src/test/java/org/springframework/data/redis/TestCondition.java index da2f4ca27..83c3012f2 100644 --- a/src/test/java/org/springframework/data/redis/TestCondition.java +++ b/src/test/java/org/springframework/data/redis/TestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import org.awaitility.Awaitility; * A condition to test periodically, used in conjunction with {@link Awaitility} * * @author Jennifer Hickey + * @author Hendrik Duerkop */ public interface TestCondition { diff --git a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java index cd97fda02..aeb499aa9 100644 --- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2021 the original author or authors. + * Copyright 2011-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package org.springframework.data.redis.connection; import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assumptions.*; -import static org.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.*; import static org.springframework.data.redis.connection.BitFieldSubCommands.*; import static org.springframework.data.redis.connection.BitFieldSubCommands.BitFieldIncrBy.Overflow.*; import static org.springframework.data.redis.connection.BitFieldSubCommands.BitFieldType.*; @@ -36,12 +36,12 @@ import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.TimeUnit; import org.assertj.core.data.Offset; -import org.awaitility.Awaitility; import org.junit.AssumptionViolatedException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.data.domain.Range.Bound; @@ -104,6 +104,7 @@ import org.springframework.data.util.Streamable; * @author Tugdual Grall * @author Dejan Jankov * @author Andrey Shlykov + * @author Hendrik Duerkop */ public abstract class AbstractConnectionIntegrationTests { diff --git a/src/test/java/org/springframework/data/redis/core/DefaultValueOperationsIntegrationTests.java b/src/test/java/org/springframework/data/redis/core/DefaultValueOperationsIntegrationTests.java index c1ff5f7ca..8977f4813 100644 --- a/src/test/java/org/springframework/data/redis/core/DefaultValueOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/core/DefaultValueOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package org.springframework.data.redis.core; import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assumptions.*; -import static org.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.*; import java.text.DecimalFormat; import java.time.Duration; @@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; import org.springframework.data.redis.ObjectFactory; -import org.springframework.data.redis.connection.AbstractConnectionIntegrationTests; import org.springframework.data.redis.test.condition.EnabledIfLongRunningTest; import org.springframework.data.redis.test.condition.EnabledOnCommand; import org.springframework.data.redis.test.extension.parametrized.MethodSource; @@ -46,6 +45,7 @@ import org.springframework.data.redis.test.extension.parametrized.ParameterizedR * @author Thomas Darimont * @author Jiahe Cai * @author Mark Paluch + * @author Hendrik Duerkop */ @MethodSource("testParams") public class DefaultValueOperationsIntegrationTests { diff --git a/src/test/java/org/springframework/data/redis/core/RedisTemplateIntegrationTests.java b/src/test/java/org/springframework/data/redis/core/RedisTemplateIntegrationTests.java index e88f04d8f..caaecbb80 100644 --- a/src/test/java/org/springframework/data/redis/core/RedisTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/core/RedisTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package org.springframework.data.redis.core; import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assumptions.*; -import static org.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.*; import java.time.Duration; import java.time.Instant; @@ -61,6 +61,7 @@ import org.springframework.data.redis.test.util.CollectionAwareComparator; * @author Duobiao Ou * @author Mark Paluch * @author ihaohong + * @author Hendrik Duerkop */ @MethodSource("testParams") public class RedisTemplateIntegrationTests { @@ -617,7 +618,7 @@ public class RedisTemplateIntegrationTests { V value1 = valueFactory.instance(); redisTemplate.boundValueOps(key1).set(value1); redisTemplate.expireAt(key1, new Date(System.currentTimeMillis() + 5L)); - await().atMost(Duration.ofMillis(5L)).until(() -> !redisTemplate.hasKey(key1)); + await().until(() -> !redisTemplate.hasKey(key1)); } @ParameterizedRedisTest // DATAREDIS-611 @@ -626,7 +627,7 @@ public class RedisTemplateIntegrationTests { V value1 = valueFactory.instance(); redisTemplate.boundValueOps(key1).set(value1); redisTemplate.expireAt(key1, Instant.now().plus(5, ChronoUnit.MILLIS)); - await().atMost(Duration.ofMillis(5L)).until(() -> !redisTemplate.hasKey(key1)); + await().until(() -> !redisTemplate.hasKey(key1)); } @ParameterizedRedisTest @@ -644,7 +645,7 @@ public class RedisTemplateIntegrationTests { template2.boundValueOps((String) key1).set((String) value1); template2.expireAt((String) key1, new Date(System.currentTimeMillis() + 5L)); // Just ensure this works as expected, pExpireAt just adds some precision over expireAt - await().atMost(Duration.ofMillis(5L)).until(() -> !template2.hasKey((String) key1)); + await().until(() -> !template2.hasKey((String) key1)); } @ParameterizedRedisTest