AutonomiccsSystemVmDeploymentService implements InitializingBean { public HostVO searchForRandomHostInCloudToDeployAutonomiccsSystemVm() { List<DataCenterVO> allZonesEnabled = zoneService.listAllZonesEnabled(); Collections.shuffle(allZonesEnabled); for (DataCenterVO dataCenterVO : allZonesEnabled) { HostVO host = searchForRandomHostInZoneToDeployAutonomiccsSystemVm(dataCenterVO); if (host != null) { return host; } } logger.info("Could not find any suitable hosts to deploy the system VM into Cloud environment"); return null; }  HostVO searchForRandomHostInCloudToDeployAutonomiccsSystemVm(); HostVO searchForRandomHostInPodToDeployAutonomiccsSystemVm(HostPodVO pod); HostVO searchForAnotherRandomHostToStartSystemVm(VMInstanceVO vmInstance); AutonomiccsSystemVm deploySystemVmWithJava(Long hostId, SystemVmType systemVmType); @Override void afterPropertiesSet();  }
@Test @PrepareForTest(AutonomiccsSystemVmDeploymentService.class) public void searchForRandomHostInCloudToDeployAutonomiccsSystemVmTest() { List<DataCenterVO> allZonesEnabled = createDataCenterVOList(); HostVO host = Mockito.mock(HostVO.class); executeSearchForRandomHostInCloudToDeployAutonomiccsSystemVmTest(allZonesEnabled, host, host, 1); }