@Test
  public void basicTest() {
    CloudDataNode cloudDataNode = new CloudDataNode(cloudConfig, clusterMapConfig);
    assertEquals("Wrong hostname", clusterMapConfig.clusterMapHostName, cloudDataNode.getHostname());
    assertEquals("Wrong datacenter name", clusterMapConfig.clusterMapDatacenterName, cloudDataNode.getDatacenterName());
    assertEquals("Wrong port", clusterMapConfig.clusterMapPort.intValue(), cloudDataNode.getPort());
    assertEquals("Wrong ssl port", cloudConfig.vcrSslPort.intValue(), cloudDataNode.getSSLPort());
    assertEquals("Wrong connect to port", PortType.SSL, cloudDataNode.getPortToConnectTo().getPortType());
    assertTrue("Should have SSL port", cloudDataNode.hasSSLPort());
    String snapshot = cloudDataNode.getSnapshot().toString();
    assertTrue("Expected hostname in snapshot", snapshot.contains(clusterMapConfig.clusterMapHostName));
    assertTrue("Expected datacenter name in snapshot", snapshot.contains(clusterMapConfig.clusterMapDatacenterName));
  }
Test the CloudDataNode constructor and methods
ambry-cloud/src/test/java/com/github/ambry/cloud/CloudDataNodeTest.java