@Test
public void testUserSpecfic() {
SessionAwareCache<Cachable> cache = new SessionAwareCache<Cachable>();
CacheID id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
Cachable result = Mockito.mock(Cachable.class);
Mockito.stub(result.prepare((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
Mockito.stub(result.restore((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
cache.put(id, Determinism.USER_DETERMINISTIC, result, null);
// make sure that in the case of session specific; we do not call prepare
// as session is local only call for distributed
Mockito.verify(result, times(1)).prepare((Cache)anyObject(), (BufferManager)anyObject());
id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
Object c = cache.get(id);
Mockito.verify(result, times(1)).restore((Cache)anyObject(), (BufferManager)anyObject());