@Test
  public void failureForInitialization() {
    assumeTrue(replicasStateEnabled);
    List<Port> portList = Collections.singletonList(new Port(PORT, PortType.PLAINTEXT));
    List<String> mountPaths = Collections.singletonList("mockMountPath");
    datanodes = new ArrayList<>(Arrays.asList(new MockDataNodeId(portList, mountPaths, "dc-0"),
        new MockDataNodeId(portList, mountPaths, "dc-1"), new MockDataNodeId(portList, mountPaths, "dc-2"),
        new MockDataNodeId(portList, mountPaths, "dc-3")));
    mockPartition = new MockPartitionId();
    populateReplicaList(4, ReplicaState.STANDBY);
    populateReplicaList(4, ReplicaState.INACTIVE);
    populateReplicaList(4, ReplicaState.DROPPED);
    localDcName = datanodes.get(0).getDatacenterName();
    mockClusterMap = new MockClusterMap(false, datanodes, 1, Collections.singletonList(mockPartition), localDcName);

    try {
      getOperationTracker(3);
      fail("Should fail to create undelete operation tracker because of insufficient eligible hosts");
    } catch (IllegalArgumentException e) {
    }
  }
Tests when there are not sufficient eligible hosts.
ambry-router/src/test/java/com/github/ambry/router/UndeleteOperationTrackerTest.java