AutonomiccsSystemVmDeploymentService implements InitializingBean { protected HostVO searchForAnotherRandomHostInTheClusterToStartSystemVmExcludingHost(HostVO excludeHost) { List<HostVO> hostToExclude = new ArrayList<>(1); hostToExclude.add(excludeHost); ClusterVO cluster = clusterService.findById(excludeHost.getClusterId()); HostVO host = searchForAnotherRandomHostInTheClusterToStartSystemVmExcludingHosts(cluster, hostToExclude); if (host != null) { return host; } logger.info(String.format("Could not find a suitable host to re-start the Autonomiccs system vms in cluster [id=%d]", excludeHost.getClusterId())); return null; }  HostVO searchForRandomHostInCloudToDeployAutonomiccsSystemVm(); HostVO searchForRandomHostInPodToDeployAutonomiccsSystemVm(HostPodVO pod); HostVO searchForAnotherRandomHostToStartSystemVm(VMInstanceVO vmInstance); AutonomiccsSystemVm deploySystemVmWithJava(Long hostId, SystemVmType systemVmType); @Override void afterPropertiesSet();  }
@Test public void searchForAnotherRandomHostInTheClusterToStartSystemVmExcludingHostTest() { HostVO expected = Mockito.mock(HostVO.class); executeSearchForAnotherRandomHostInTheClusterToStartSystemVmExcludingHostTest(expected, 1); }