addProviderExpectation(key1, null,
new ProviderResult(value1, root, false, null));
// Retrieve the object, this will work and mark the entry as
// uncacheable.
Object value = cache.retrieve(key1);
assertSame(value1, value);
// Expect a request for an uncacheable entry that fails with an error.
Throwable throwable = new Error();
addUncacheableProviderExpectation(key1, throwable);