AutonomiccsSystemVmDeploymentService implements InitializingBean { public HostVO searchForAnotherRandomHostToStartSystemVm(VMInstanceVO vmInstance) { Long hostId = vmInstance.getHostId(); if (hostId == null) { Long podId = vmInstance.getPodIdToDeployIn(); return searchForRandomHostInPodToDeployAutonomiccsSystemVm(podService.findPodById(podId)); } HostVO hostInWhichVmWasRunning = hostService.findHostById(hostId); return searchForAnotherRandomHostInTheClusterToStartSystemVmExcludingHost(hostInWhichVmWasRunning); }  HostVO searchForRandomHostInCloudToDeployAutonomiccsSystemVm(); HostVO searchForRandomHostInPodToDeployAutonomiccsSystemVm(HostPodVO pod); HostVO searchForAnotherRandomHostToStartSystemVm(VMInstanceVO vmInstance); AutonomiccsSystemVm deploySystemVmWithJava(Long hostId, SystemVmType systemVmType); @Override void afterPropertiesSet();  }
@Test public void searchForAnotherRandomHostToStartSystemVmTest() { executeSearchForAnotherRandomHostToStartSystemVmTest(0l, 0, 1); }