@Test
  public void testGetPeerForFileCopyWithLeaderFoundAndUnAvailable() {
    List<String> mountPaths = new ArrayList<>();
    mountPaths.add("/tmp/1");
    mountPaths.add("/tmp/2");
    Port port = new Port(1, PortType.PLAINTEXT);

    MockDataNodeId dataNodeId =
        new MockDataNodeId("peerNode", Collections.singletonList(port), mountPaths, "peerDatacenter");

    PartitionId partitionId =
        new MockPartitionId(100, MockClusterMap.DEFAULT_PARTITION_CLASS, Collections.singletonList(dataNodeId), 0);
    // Get Healthy Leader replica first
    ReplicaId replicaId = FileCopyUtils.getPeerForFileCopy(partitionId, "peerDatacenter");
    assertNotNull(replicaId);
    // Mark replica as unhealthy
    replicaId.markDiskDown();

    // we should not get any replica now as leader is unhealthy
    replicaId = FileCopyUtils.getPeerForFileCopy(partitionId, "peerDatacenter");
    assertNull(replicaId);
  }
Test for {@link FileCopyUtils#getPeerForFileCopy(PartitionId, String)}
Test if a LEADER replica is found in the given datacenter and it is not healthy
we do not get any replica
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/FileCopyUtilsTest.java