private void mockDaos(boolean pluggedInterface) { VM vm = createVM(VM_NAME, NETWORK_NAME, pluggedInterface); when(vmDao.getAllRunningForVds(any(Guid.class))).thenReturn(Arrays.asList(vm)); when(vmNetworkInterfaceDao.getAllForVm(vm.getId())).thenReturn(vm.getInterfaces()); }