CacheRepositoryImpl implements CacheRepository { public void put(Object key, Object value) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Putting object in cache [" + cacheName + "] for key [" + key + "]"); } getCache().put(key, value); }  EhCacheCacheManager getEhCacheCacheManager(); void setEhCacheCacheManager(EhCacheCacheManager ehCacheCacheManager); String getCacheName(); void setCacheName(String cacheName); Object get(Object key); void put(Object key, Object value); void evict(Object key); Object getNativeCache(); long getMemoryUsage(); long getMemoryStoreSize();  }
@Test public void put() { CacheRepository cacheRepository = new CacheRepositoryImpl(); ((CacheRepositoryImpl) cacheRepository).setCacheName(cacheName); ((CacheRepositoryImpl) cacheRepository).setEhCacheCacheManager(ehCacheCacheManager); String keyPut = "keyPut1"; String valPut = "valPut1"; cacheRepository.put(keyPut, valPut); Assert.assertTrue("Same value should be retrieved ", valPut.equals(cacheRepository.get(keyPut))); }