LocatorClusterManagementService implements ClusterManagementService { @Override public <A extends ClusterManagementOperation<V>, V extends OperationResult> ClusterManagementOperationResult<A, V> start( A op) { OperationState<A, V> operationState = operationManager.submit(op); return assertSuccessful(toClusterManagementOperationResult(StatusCode.ACCEPTED, "Operation started. Use the URI to check its status.", operationState)); } LocatorClusterManagementService(InternalCache cache,
      InternalConfigurationPersistenceService persistenceService); @VisibleForTesting  LocatorClusterManagementService(
      InternalCache cache,
      InternalConfigurationPersistenceService persistenceService,
      Map<Class, ConfigurationManager> managers,
      Map<Class, ConfigurationValidator> validators,
      MemberValidator memberValidator,
      CommonConfigurationValidator commonValidator,
      OperationManager operationManager); @Override ClusterManagementRealizationResult create(T config); @Override ClusterManagementRealizationResult delete(
      T config); @Override ClusterManagementRealizationResult update(
      T config); @Override ClusterManagementListResult<T, R> list(
      T filter); @Override ClusterManagementGetResult<T, R> get(
      T config); @Override ClusterManagementOperationResult<A, V> start(
      A op); @Override ClusterManagementListOperationsResult<A, V> list(
      A opType); @Override ClusterManagementOperationResult<A, V> get(
      A opType, String opId); @Override CompletableFuture<ClusterManagementOperationResult<A, V>> getFuture(
      A opType, String opId); boolean isConnected(); @Override void close(); @VisibleForTesting
  // the dlock service name used by the CMS
  static final String CMS_DLOCK_SERVICE_NAME; }
@Test public void startOperation() { final String URI = "/test/uri"; ClusterManagementOperation<OperationResult> operation = mock(ClusterManagementOperation.class); when(operation.getEndpoint()).thenReturn(URI); when(operationManager.submit(any())) .thenReturn(new OperationState<>("42", operation, new Date())); ClusterManagementOperationResult<?, ?> result = service.start(operation); assertThat(result.getStatusCode()).isEqualTo(ClusterManagementResult.StatusCode.ACCEPTED); assertThat(result.getStatusMessage()).contains("Operation started"); }