@Test
public void listAllHostsInClusterTest() {

    String str = null;
    List<HostVO> hosts = new ArrayList<>();
    HostVO host1 = Mockito.mock(HostVO.class);
    hosts.add(host1);
    HostVO host2 = Mockito.mock(HostVO.class);
    hosts.add(host2);
    Cluster cluster = Mockito.mock(Cluster.class);
    Mockito.when(cluster.getId()).thenReturn(0l);
    Mockito.when(cluster.getPodId()).thenReturn(0l);
    Mockito.when(cluster.getDataCenterId()).thenReturn(0l);
    Mockito.doReturn(hosts).when(hostDao).listAllUpAndEnabledNonHAHosts(Mockito.eq(Type.Routing), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(),
            Mockito.eq(str));
    spy.listAllHostsInCluster(cluster);
    Mockito.verify(cluster).getId();
    Mockito.verify(cluster).getPodId();
    Mockito.verify(cluster).getDataCenterId();
    Mockito.verify(hostDao).listAllUpAndEnabledNonHAHosts(Mockito.eq(Type.Routing), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.eq(str));
}