### Question:
DataObjectMapperCacheWrapper extends AbstractCacheWrapper implements IDataObjectMapperCacheWrapper { @Override public void initCache(IPageManager pageManager) throws ApsSystemException { try { DataObjectPageMapper dataObjectPageMapper = new DataObjectPageMapper(); IPage root = pageManager.getOnlineRoot(); this.searchPublishedDataObjects(dataObjectPageMapper, root, pageManager); this.getCache().put(OBJECT_MAPPER_CACHE_KEY, dataObjectPageMapper); } catch (Throwable t) { logger.error("Error loading data object mapper", t); throw new ApsSystemException("Error loading data object mapper", t); } }  @Override void initCache(IPageManager pageManager); @Override String getPageCode(String dataId);  }### Answer:
@Test(expected = ApsSystemException.class) public void testInitCacheWithError() throws Throwable { cacheWrapper.initCache(this.pageManager); }
@Test public void testInitCache() throws Throwable { Mockito.when(pageManager.getOnlineRoot()).thenReturn(this.createMockPage()); Mockito.when(cacheManager.getCache(IDataObjectMapperCacheWrapper.OBJECT_MAPPER_CACHE_NAME)).thenReturn(this.cache); cacheWrapper.initCache(this.pageManager); }