Skip to content

Tag: imcache

Mock methods that manipulate parameters

Recently, I’ve worked a little bit on redis cache for Imcache. I needed to mock a behavior of a method where the method manipulates given parameters e.g. change state or call another method. After a little bit of research, I’ve found out there’s a nice mockito feature that accomplishes what I want: doAnswer. Basically, doAnswer allows stubbing a void method with a generic answer. While answering the…

2 Comments

Spring Cache Abstraction

Spring cache abstraction applies caching to the Java methods. It provides an environment where we can cache the result for the methods we choose. By doing so, it improves the performance of the methods by avoiding multiple execution of the methods for the same object. Note that this type of caching can be applied to the methods which return the same result for the same input. In…

Leave a Comment