@Test
  public void cloudServiceClusterManagerComponentsTest() throws Exception {
    MockClusterManagerQueryHelper mockClusterManagerCallback = new MockClusterManagerQueryHelper();
    AmbryPartition partition = new AmbryPartition(1, "abc", mockClusterManagerCallback);

    String dcName = "cloud-dc";
    CloudServiceDataNode node = new CloudServiceDataNode(dcName, clusterMapConfig1);
    assertEquals(dcName, node.getHostname());
    assertEquals(dcName, node.getDatacenterName());
    assertEquals(DataNodeId.UNKNOWN_PORT, node.getPort());
    assertEquals(new Port(DataNodeId.UNKNOWN_PORT, PortType.PLAINTEXT), node.getPortToConnectTo());
    assertNull(node.getRackId());
    assertEquals(DEFAULT_XID, node.getXid());
    // the snapshot is for debug info, but just check that it works without throwing exceptions.
    assertNotNull(node.getSnapshot());

    CloudServiceReplica replica =
        new CloudServiceReplica(clusterMapConfig1, node, partition, MAX_REPLICA_CAPACITY_IN_BYTES);

    assertException(UnsupportedOperationException.class, replica::getDiskId, null);
    assertEquals(node, replica.getDataNodeId());
    assertException(UnsupportedOperationException.class, replica::getMountPath, null);
    assertException(UnsupportedOperationException.class, replica::getReplicaPath, null);
    assertEquals(ReplicaType.CLOUD_BACKED, replica.getReplicaType());
    assertNotNull(replica.getSnapshot());
    assertNotNull(replica.toString());
    assertException(UnsupportedOperationException.class, replica::markDiskDown, null);
    assertException(UnsupportedOperationException.class, replica::markDiskUp, null);
  }
Test {@link AmbryDataNode}, {@link AmbryDisk}, {@link AmbryPartition} and {@link AmbryReplica}.
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/DynamicClusterManagerComponentsTest.java