Skip to content

Commit dfbbc49

Browse files
committed
Fix BackupManagerTest failure
1 parent f14e93c commit dfbbc49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/test/java/org/apache/cloudstack/backup/BackupManagerTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ public void testCreateBackupLimitReached() throws ResourceAllocationException {
660660
BackupOfferingVO offering = Mockito.mock(BackupOfferingVO.class);
661661
when(backupOfferingDao.findById(backupOfferingId)).thenReturn(offering);
662662
when(offering.isUserDrivenBackupAllowed()).thenReturn(true);
663+
when(offering.getProvider()).thenReturn("testbackupprovider");
663664

664665
BackupScheduleVO schedule = mock(BackupScheduleVO.class);
665666
when(schedule.getScheduleType()).thenReturn(DateUtil.IntervalType.DAILY);
@@ -699,6 +700,7 @@ public void testCreateBackupStorageLimitReached() throws ResourceAllocationExcep
699700
BackupOfferingVO offering = Mockito.mock(BackupOfferingVO.class);
700701
when(backupOfferingDao.findById(backupOfferingId)).thenReturn(offering);
701702
when(offering.isUserDrivenBackupAllowed()).thenReturn(true);
703+
when(offering.getProvider()).thenReturn("testbackupprovider");
702704

703705
BackupScheduleVO schedule = mock(BackupScheduleVO.class);
704706
when(schedule.getScheduleType()).thenReturn(DateUtil.IntervalType.DAILY);
@@ -1122,6 +1124,7 @@ public void testRestoreBackupToVM() throws NoTransitionException {
11221124

11231125
BackupVO backup = mock(BackupVO.class);
11241126
when(backup.getBackupOfferingId()).thenReturn(offeringId);
1127+
when(backup.getStatus()).thenReturn(Backup.Status.BackedUp);
11251128

11261129
VMInstanceVO vm = mock(VMInstanceVO.class);
11271130
when(vmInstanceDao.findByIdIncludingRemoved(vmId)).thenReturn(vm);
@@ -1177,6 +1180,7 @@ public void testRestoreBackupToVMException() throws NoTransitionException {
11771180

11781181
BackupVO backup = mock(BackupVO.class);
11791182
when(backup.getBackupOfferingId()).thenReturn(offeringId);
1183+
when(backup.getStatus()).thenReturn(Backup.Status.BackedUp);
11801184

11811185
VMInstanceVO vm = mock(VMInstanceVO.class);
11821186
when(vmInstanceDao.findByIdIncludingRemoved(vmId)).thenReturn(vm);

0 commit comments

Comments
 (0)