TestingUtil.replaceComponent(cache, ClusterCacheNotifier.class, notifier, true);
return realNotifier;
}
protected EntryRetriever waitUntilRetrievingIterator(final Cache<?, ?> cache, final CheckPoint checkPoint) {
EntryRetriever retriever = TestingUtil.extractComponent(cache, EntryRetriever.class);
final Answer<Object> forwardedAnswer = AdditionalAnswers.delegatesTo(retriever);
EntryRetriever mockRetriever = mock(EntryRetriever.class, withSettings().defaultAnswer(forwardedAnswer));
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
// Wait for main thread to sync up
checkPoint.trigger("pre_retrieve_entry_invoked");