File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
test/java/org/apache/cloudstack/backup Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -9513,7 +9513,8 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
95139513 if (overrideDiskOffering.isComputeOnly()) {
95149514 updateDetailsWithRootDiskAttributes(cmd.getDetails(), rootVmDiskInfoFromBackup);
95159515 } else {
9516- Long rootDiskSize = Long.parseLong(cmd.getDetails().getOrDefault(VmDetailConstants.ROOT_DISK_SIZE, null));
9516+ String diskSizeFromDetails = cmd.getDetails().get(VmDetailConstants.ROOT_DISK_SIZE);
9517+ Long rootDiskSize = diskSizeFromDetails == null ? null : Long.parseLong(diskSizeFromDetails);
95179518 checkRootDiskSizeAgainstBackup(rootDiskSize, overrideDiskOffering, rootVmDiskInfoFromBackup.getSize());
95189519 }
95199520 }
Original file line number Diff line number Diff line change @@ -1207,21 +1207,6 @@ public void testRemoveVMFromBackupOffering() {
12071207 }
12081208 }
12091209
1210- @ Test
1211- public void testDeleteBackupScheduleById () {
1212- Long scheduleId = 1L ;
1213- DeleteBackupScheduleCmd cmd = new DeleteBackupScheduleCmd ();
1214- ReflectionTestUtils .setField (cmd , "id" , scheduleId );
1215-
1216- BackupScheduleVO schedule = mock (BackupScheduleVO .class );
1217- when (schedule .getId ()).thenReturn (scheduleId );
1218- when (backupScheduleDao .findById (scheduleId )).thenReturn (schedule );
1219- when (backupScheduleDao .remove (scheduleId )).thenReturn (true );
1220-
1221- boolean result = backupManager .deleteBackupSchedule (cmd );
1222- assertTrue (result );
1223- }
1224-
12251210 @ Test
12261211 public void testDeleteBackupScheduleByVmId () {
12271212 Long vmId = 1L ;
@@ -1232,7 +1217,6 @@ public void testDeleteBackupScheduleByVmId() {
12321217 overrideBackupFrameworkConfigValue ();
12331218
12341219 VMInstanceVO vm = mock (VMInstanceVO .class );
1235- when (vm .getId ()).thenReturn (vmId );
12361220 when (vmInstanceDao .findById (vmId )).thenReturn (vm );
12371221 BackupScheduleVO schedule = mock (BackupScheduleVO .class );
12381222 when (schedule .getId ()).thenReturn (scheduleId );
You can’t perform that action at this time.
0 commit comments