@Test
  public void testGetPeerForFileCopyWithLeaderFoundAndAvailable() {
    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);

    ReplicaId replicaId = FileCopyUtils.getPeerForFileCopy(partitionId, "peerDatacenter");
    assertNotNull(replicaId);
    PartitionId leaderPartition =
        replicaId.getPartitionId().getReplicaIdsByState(ReplicaState.LEADER, "peerDatacenter").get(0).getPartitionId();
    assertEquals(partitionId, leaderPartition);
    assertFalse(replicaId.isDown());
  }
Test for {@link FileCopyUtils#getPeerForFileCopy(PartitionId, String)}
Test if a LEADER replica is found in the given datacenter and it is healthy
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/FileCopyUtilsTest.java