skip to Main Content

How to mock HashOperations of Spring StringRedisTemplate?

I'm writing unit test for my CacheService class: public class CacheService { private final HashOperations<String, String, String> redisHashOps; private final ValueOperations<String, String> valueOps; private final SetOperations<String, String> setOps; public CacheService(StringRedisTemplate redisTemplate) { this.redisHashOps = redisTemplate.opsForHash(); this.valueOps = redisTemplate.opsForValue(); this.setOps =…

VIEW QUESTION

Error when importing Redis client into Typescript app

When importing the npm Redis module into a TypeScript application, I receive the error: node_modules/@node-redis/client/dist/lib/client/index.d.ts:45:78 - error TS1256: A rest element must be last in a tuple type. 45 export declare type ClientLegacyCommandArguments = LegacyCommandArguments | [...LegacyCommandArguments, ClientLegacyCallback]; The error…

VIEW QUESTION

Handle redis connection reset

We are facing [Errno 54] Connection reset by peer at very random in our application and looks like it is being triggered by redis server than client. Python's redis client have backoff strategy implementation but it's unable to handle this…

VIEW QUESTION
Back To Top
Search