@Test
  public void basicTest() {
    MockPartitionId mockPartitionId = new MockPartitionId();
    CloudDataNode cloudDataNode = new CloudDataNode(cloudConfig, clusterMapConfig);
    CloudReplica cloudReplica = new CloudReplica(new MockPartitionId(), cloudDataNode);
    assertEquals("Wrong mount path", mockPartitionId.toPathString(), cloudReplica.getMountPath());
    assertEquals("Wrong replica path",
        Cloud_Replica_Keyword + File.separator + mockPartitionId.toPathString() + File.separator
            + mockPartitionId.toPathString(), cloudReplica.getReplicaPath());
    assertEquals("Wrong dataNodeId", cloudDataNode, cloudReplica.getDataNodeId());
    assertEquals("Wrong partitionId", mockPartitionId, cloudReplica.getPartitionId());
    assertEquals("Wrong peer replicaIds", mockPartitionId.getReplicaIds(), cloudReplica.getPeerReplicaIds());
    String snapshot = cloudReplica.getSnapshot().toString();
    assertTrue("Expected hostname in snapshot", snapshot.contains(cloudReplica.getDataNodeId().getHostname()));
    assertTrue("Expected partitionId in snapshot", snapshot.contains(cloudReplica.getPartitionId().toPathString()));
  }
Test the CloudReplica constructor and methods
ambry-clustermap/src/test/java/com/github/ambry/clustermap/CloudReplicaTest.java