OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
OperationServicesAdapter operationsService = new OperationServicesAdapter(operationManager);
long timeout = 1000 * 60;
OperationContextImpl operationContext = new OperationContextImpl(newStorageNode.getId(), operationManager);
OperationServicesResult result = operationsService.invokeOperation(operationContext, "prepareForBootstrap",
params, timeout);
log.info("Waiting for node to boostrap...");
// When a node goes through bootstrap, StorageService sleeps for RING_DELAY ms
// while it determines the ranges of the token ring it will own. RING_DELAY defaults
// to 30 seconds by default but we are overriding it to be 100 ms.
Thread.sleep(3000);
assertEquals(result.getResultCode(), OperationServicesResultCode.SUCCESS, "The operation failed: " +
result.getErrorStackTrace());
assertNodeIsUp("Expected " + newStorageNode + " to be up after the prepareForBootstrap operation completes.");
assertThatInternodeAuthConfFileMatches("127.0.0.1", "127.0.0.2");