use of org.sagebionetworks.bridge.cache.CacheProvider in project BridgeServer2 by Sage-Bionetworks.
the class TagControllerTest method getTagsNotCached.
@Test
public void getTagsNotCached() throws Exception {
when(mockViewCache.getView(eq(CacheKey.tagList()), any())).thenReturn(null);
CacheProvider mockProvider = mock(CacheProvider.class);
ViewCache viewCache = new ViewCache();
viewCache.setCacheProvider(mockProvider);
viewCache.setObjectMapper(BridgeObjectMapper.get());
controller.setViewCache(viewCache);
Map<String, List<String>> map = ImmutableMap.of("a", ImmutableList.of("1", "2", "3"));
when(mockService.getTags()).thenReturn(map);
String retValue = controller.getTags();
assertEquals(retValue, JSON);
}
Aggregations