when(vmInstanceDao.listByLastHostId(5L)).thenReturn(stoppedVmsForHost);
when(vmInstanceDao.listByLastHostId(6L)).thenReturn(stoppedVmsForHost);
when(vmInstanceDao.listByLastHostId(7L)).thenReturn(stoppedVmsForHost);
// Mock the offering with which the vm was created.
ServiceOfferingVO offeringForVmOfThisAccount = mock(ServiceOfferingVO.class);
when(serviceOfferingDao.findByIdIncludingRemoved(offeringIdForVmsOfThisAccount)).thenReturn(offeringForVmOfThisAccount);
when(offeringForVmOfThisAccount.getDeploymentPlanner()).thenReturn(planner.getName());
ServiceOfferingVO offeringForVMOfOtherAccount = mock(ServiceOfferingVO.class);
when(serviceOfferingDao.findByIdIncludingRemoved(offeringIdForVmsOfOtherAccount)).thenReturn(offeringForVMOfOtherAccount);
when(offeringForVMOfOtherAccount.getDeploymentPlanner()).thenReturn("FirstFitPlanner");
}