use of org.ovirt.engine.core.common.vdscommands.VDSCommandType in project ovirt-engine by oVirt.
the class VmSlaPolicyCommandTest method setUp.
@Before
public void setUp() {
doAnswer(invocation -> {
VDSCommandType commandType = (VDSCommandType) invocation.getArguments()[0];
assertEquals(VDSCommandType.UpdateVmPolicy, commandType);
UpdateVmPolicyVDSParams params = (UpdateVmPolicyVDSParams) invocation.getArguments()[1];
VDSReturnValue retVal = new VDSReturnValue();
retVal.setSucceeded(vdsFunction.apply(params));
return retVal;
}).when(command).runVdsCommand(any(), any());
vm = new VM();
vm.setId(VM_ID);
vm.setStatus(VMStatus.Up);
when(vmDao.get(VM_ID)).thenReturn(vm);
diskImage = new DiskImage();
diskImage.setStorageIds(new ArrayList<>());
diskImage.getStorageIds().add(DISK_DOMAIN_ID);
diskImage.setStoragePoolId(DISK_POOL_ID);
diskImage.setId(DISK_IMAGE_ID);
diskImage.setImageId(DISK_VOLUME_ID);
}
Aggregations