TestingUtil.replaceComponent(c2, StateProvider.class, spyStateProvider, true);
doAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
int topologyId = (Integer) invocation.getArguments()[1];
checkpoint.trigger("GET_TRANSACTIONS");
log.debugf("Blocking the GET_TRANSACTIONS(%d) command on the %s", topologyId, c2);
checkpoint.awaitStrict("LEAVE", 10, TimeUnit.SECONDS);
return invocation.callRealMethod();
}
}).when(spyStateProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySet());