TestingUtil.replaceComponent(cache, RpcManager.class, mockManager, true);
return rpc;
}
protected EntryRetriever waitUntilStartOfProcessingResult(final Cache<?, ?> cache, final CheckPoint checkPoint) {
EntryRetriever rpc = TestingUtil.extractComponent(cache, EntryRetriever.class);
final Answer<Object> forwardedAnswer = AdditionalAnswers.delegatesTo(rpc);
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_receive_response_invoked");