DATAREDIS-367 - Polishing.

Add author tag and Override annotation. Update test to use try-with-resources.

Original pull request: #506.
This commit is contained in:
Mark Paluch
2020-01-10 11:29:40 +01:00
parent 163e9d4fac
commit f823062ef0
2 changed files with 6 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ import org.springframework.data.redis.ConnectionFactoryTracker;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisClusterConnection;
import org.springframework.data.redis.connection.RedisConfiguration;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisPassword;
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.data.redis.connection.RedisSocketConfiguration;
@@ -800,7 +801,9 @@ public class LettuceConnectionFactoryUnitTests {
connectionFactory.setValidateConnection(true);
connectionFactory.afterPropertiesSet();
connectionFactory.getConnection().close();
try (RedisConnection connection = connectionFactory.getConnection()) {
connection.ping();
}
verify(syncMock).ping();
}