I am using below mentioned code to get the cache but it will work at server environment need to write Junit test case for the same , could some one please help me out.
I am using EasyMock for mocking.
public Object get(final Object key, final String jndiName) throws CacheException{
DistributedMap cacheMap = null;
try {
final InitialContext ic = new InitialContext();
cacheMap = (DistributedMap) ic.lookup(jndiName);
return cacheMap.get(key);
} catch (final Exception ex) {
throw new Exception(ex)
}
}