@Test
  public void testOperationStatusWhenLocatorLeftTheMembership() {

    List<String> regionNames = getAllRegionNames();
    createAndPopulateRegions(regionNames);

    int numberOfServers = servers.size();
    regionNames.forEach(region -> locator1
        .waitUntilRegionIsReadyOnExactlyThisManyServers(SEPARATOR + region, numberOfServers));

    RestoreRedundancyRequest restoreRedundancyRequest = new RestoreRedundancyRequest();

    restoreRedundancyRequest.setIncludeRegions(regionNames);

    ClusterManagementOperationResult<RestoreRedundancyRequest, RestoreRedundancyResults> startResult =
        client1.start(restoreRedundancyRequest);

    // This should cause status of restoreRedundancyRequest to be ERROR
    locator1.stop();

    // The ClientClusterManagementService is implemented such that if there is an
    // error in the status of operation command (in this case earlier RestoreRedundancyRequest)
    // the get() method throws an exception even though the get has successfully retrieved the
    // operation status.
    assertThatExceptionOfType(ClusterManagementException.class)
        .isThrownBy(() -> client2.get(restoreRedundancyRequest, startResult.getOperationId()))
        .withMessageContaining("Locator that initiated the Rest API operation is offline: ")
        .extracting(ClusterManagementException::getStatusCode)
        .isEqualTo(ClusterManagementResult.StatusCode.ERROR);
  }
This class borrows very heavily from the RestoreRedundancyCommandDUnitTest
geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java