1

I'm trying to unit test a piece of code and I want to mock the redissionClient.createBatch() method call which returns the RBatch object.

Code snippet looks like:

RBatch batch =redissonClient.createBatch();

How do I handle

Mockito.when(redissonClient.createBatch()).thenReturn(*!!facing issue here in object creation!!*)
Harihara_K
  • 174
  • 16
  • RBatch Is an interface - you can either implement it or mock it. But I think that you wont get a lot of leverage stubbing low-level db/cache driver access. Instead, mock your repository, and test your db access against a real database. – Lesiak Jul 11 '22 at 19:45

0 Answers0