@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
int viewId = (Integer) invocation.getArguments()[2];
checkpoint.trigger("rebalance_" + viewId);
log.debugf("Blocking the REBALANCE_START command on the merge coordinator");
checkpoint.awaitStrict("merge", 30, TimeUnit.SECONDS);
return invocation.callRealMethod();
}
}).when(spyLocalTopologyManager).handleRebalance(eq(CACHE_NAME), any(CacheTopology.class), anyInt());
TestingUtil.replaceComponent(mergeCoordManager, LocalTopologyManager.class, spyLocalTopologyManager, true);