@Test
  public void successWithSufficientHostsNotDownTest() {
    initialize();
    // The first 4 replicas belong to four different datacenter, mark them as down. Since each datacenter has 3 replica,
    // then the first 8 hosts should reach the global quorum.
    for (int i = 0; i < 4; i++) {
      ((MockReplicaId) mockPartition.getReplicaIds().get(i)).markReplicaDownStatus(true);
    }
    UndeleteOperationTracker tracker = getOperationTracker(2);
    // Now we need to set all the response to be success
    for (int i = 0; i < 4; i++) {
      sendRequests(tracker, 2);
      assertFalse("Operation should not have failed", tracker.hasFailed());
      assertFalse("Operation should not have succeeded", tracker.hasSucceeded());
      assertFalse("Operation should not be done", tracker.isDone());
      for (int j = 0; j < 2; j++) {
        tracker.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.SUCCESS);
      }
    }
    assertFalse("Operation should not have failed", tracker.hasFailed());
    assertTrue("Operation should have succeeded", tracker.hasSucceeded());
    assertTrue("Operation should be done", tracker.isDone());
  }
Tests when some hosts are down.
ambry-router/src/test/java/com/github/ambry/router/UndeleteOperationTrackerTest.java