Skip to content

Commit

Permalink
Fixing CacheService unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
  • Loading branch information
sgup432 committed Feb 27, 2024
1 parent 2586fa1 commit 6a2b374
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Map;

import static junit.framework.TestCase.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand All @@ -42,7 +44,7 @@ public void testWithCreateCacheForIndicesRequestCacheType() {
);
CacheConfig<String, String> config = mock(CacheConfig.class);
ICache<String, String> onHeapCache = mock(OpenSearchOnHeapCache.class);
when(factory1.create(config, CacheType.INDICES_REQUEST_CACHE, factoryMap)).thenReturn(onHeapCache);
when(factory1.create(eq(config), eq(CacheType.INDICES_REQUEST_CACHE), any(Map.class))).thenReturn(onHeapCache);

CacheService cacheService = cacheModule.getCacheService();
ICache<String, String> ircCache = cacheService.createCache(config, CacheType.INDICES_REQUEST_CACHE);
Expand Down

0 comments on commit 6a2b374

Please sign in to comment.