Source:
<code>protected void initializeCommand(UpdateVmDiskParameters params, List<VM> vms) { mockCtorRelatedDaoCalls(vms); command = spy(new UpdateVmDiskCommand<UpdateVmDiskParameters>(params) { @SuppressWarnings("synthetic-access") @Override protected DiskDao getDiskDao() { return diskDao; } @Override public VmDAO getVmDAO() { return vmDAO; } }); doReturn(true).when(command).acquireLockInternal(); doReturn(snapshotDao).when(command).getSnapshotDao(); doReturn(diskImageDao).when(command).getDiskImageDao(); doReturn(storagePoolDao).when(command).getStoragePoolDAO(); <START> doReturn(storageDomainDao).when(command).getStorageDomainDAO(); <END> doReturn(vmStaticDAO).when(command).getVmStaticDAO(); doReturn(baseDiskDao).when(command).getBaseDiskDao(); doReturn(imageDao).when(command).getImageDao(); doReturn(vmDeviceDAO).when(command).getVmDeviceDao(); doReturn(vmDAO).when(command).getVmDAO(); doReturn(diskDao).when(command).getDiskDao(); doNothing().when(command).reloadDisks(); doNothing().when(command).updateBootOrder(); doNothing().when(vmStaticDAO).incrementDbGeneration(any(Guid.class)); ejbRule.mockResource(ContainerManagedResourceType.TRANSACTION_MANAGER, new DummyTransactionManager()); SnapshotsValidator snapshotsValidator = mock(SnapshotsValidator.class); doReturn(snapshotsValidator).when(command).getSnapshotsValidator(); doReturn(ValidationResult.VALID).when(snapshotsValidator).vmNotDuringSnapshot(any(Guid.class)); doReturn(ValidationResult.VALID).when(snapshotsValidator).vmNotInPreview(any(Guid.class)); mockVds(); mockVmsStoragePoolInfo(vms); mockToUpdateDiskVm(vms); }</code><technical_language>storage domain static dao now</technical_language>

Target:
protected void initializeCommand(UpdateVmDiskParameters params, List<VM> vms) { mockCtorRelatedDaoCalls(vms); command = spy(new UpdateVmDiskCommand<UpdateVmDiskParameters>(params) { @SuppressWarnings("synthetic-access") @Override protected DiskDao getDiskDao() { return diskDao; } @Override public VmDAO getVmDAO() { return vmDAO; } }); doReturn(true).when(command).acquireLockInternal(); doReturn(snapshotDao).when(command).getSnapshotDao(); doReturn(diskImageDao).when(command).getDiskImageDao(); doReturn(storagePoolDao).when(command).getStoragePoolDAO(); doReturn(storageDomainStaticDao).when(command).getStorageDomainStaticDAO(); doReturn(vmStaticDAO).when(command).getVmStaticDAO(); doReturn(baseDiskDao).when(command).getBaseDiskDao(); doReturn(imageDao).when(command).getImageDao(); doReturn(vmDeviceDAO).when(command).getVmDeviceDao(); doReturn(vmDAO).when(command).getVmDAO(); doReturn(diskDao).when(command).getDiskDao(); doNothing().when(command).reloadDisks(); doNothing().when(command).updateBootOrder(); doNothing().when(vmStaticDAO).incrementDbGeneration(any(Guid.class)); ejbRule.mockResource(ContainerManagedResourceType.TRANSACTION_MANAGER, new DummyTransactionManager()); SnapshotsValidator snapshotsValidator = mock(SnapshotsValidator.class); doReturn(snapshotsValidator).when(command).getSnapshotsValidator(); doReturn(ValidationResult.VALID).when(snapshotsValidator).vmNotDuringSnapshot(any(Guid.class)); doReturn(ValidationResult.VALID).when(snapshotsValidator).vmNotInPreview(any(Guid.class)); mockVds(); mockVmsStoragePoolInfo(vms); mockToUpdateDiskVm(vms); }