@Test
public void testDeleteHost() throws Exception {

  // Given
  String clusterName = "TEST_DELETE_HOST";
  String hostName1 = "HOSTNAME1", hostName2 = "HOSTNAME2";
  String hostToDelete = hostName2;
  clusters.addCluster(clusterName, new StackId("HDP-2.1.1"));
  Cluster cluster = clusters.getCluster(clusterName);
  clusters.addHost(hostName1);
  clusters.addHost(hostName2);
  Host host1 = clusters.getHost(hostName1);
  host1.setHostAttributes(ImmutableMap.of("os_family", "centos", "os_release_version", "6.0"));
  Host host2 = clusters.getHost(hostName2);
  host2.setHostAttributes(ImmutableMap.of("os_family", "centos", "os_release_version", "6.0"));
  clusters.mapAndPublishHostsToCluster(Sets.newHashSet(hostName1, hostName2), clusterName);
  // When
  clusters.deleteHost(hostToDelete);
  // Then
  assertTrue(clusters.getClustersForHost(hostToDelete).isEmpty());
  assertFalse(clusters.getHostsForCluster(clusterName).containsKey(hostToDelete));
  assertFalse(cluster.getHosts().contains(hostToDelete));
  try {
    clusters.getHost(hostToDelete);
    fail("getHost(hostName) should throw Exception when invoked for deleted host !");
  }
  catch(HostNotFoundException e){
  }
}