Skip to content

Commit 57eb794

Browse files
committed
fix issue with test
1 parent 021fb88 commit 57eb794

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
import static org.junit.Assert.assertTrue;
126126
import static org.junit.Assert.fail;
127127
import static org.mockito.ArgumentMatchers.any;
128+
import static org.mockito.ArgumentMatchers.anyLong;
129+
import static org.mockito.ArgumentMatchers.anyString;
128130
import static org.mockito.Mockito.doNothing;
129131
import static org.mockito.Mockito.doReturn;
130132
import static org.mockito.Mockito.mock;
@@ -2525,6 +2527,7 @@ public void testCloneBackupOfferingUsesProvidedDomainIds() {
25252527
Long sourceOfferingId = 1L;
25262528
Long zoneId = 10L;
25272529
Long savedOfferingId = 2L;
2530+
String externalId = UUID.randomUUID().toString();
25282531
List<Long> providedDomainIds = List.of(11L);
25292532

25302533
// command
@@ -2534,12 +2537,13 @@ public void testCloneBackupOfferingUsesProvidedDomainIds() {
25342537
when(cmd.getDescription()).thenReturn(null);
25352538
when(cmd.getExternalId()).thenReturn(null);
25362539
when(cmd.getUserDrivenBackups()).thenReturn(null);
2540+
when(cmd.getZoneId()).thenReturn(null);
25372541
when(cmd.getDomainIds()).thenReturn(providedDomainIds);
25382542

25392543
// source offering
25402544
BackupOfferingVO sourceOffering = Mockito.mock(BackupOfferingVO.class);
25412545
when(sourceOffering.getZoneId()).thenReturn(zoneId);
2542-
when(sourceOffering.getExternalId()).thenReturn("ext-src");
2546+
when(sourceOffering.getExternalId()).thenReturn(externalId);
25432547
when(sourceOffering.getProvider()).thenReturn("testbackupprovider");
25442548
when(sourceOffering.getDescription()).thenReturn("src desc");
25452549
when(sourceOffering.isUserDrivenBackupAllowed()).thenReturn(true);
@@ -2581,6 +2585,7 @@ public void testCloneBackupOfferingInheritsDomainIdsFromSource() {
25812585
when(cmd.getDescription()).thenReturn(null);
25822586
when(cmd.getExternalId()).thenReturn(null);
25832587
when(cmd.getUserDrivenBackups()).thenReturn(null);
2588+
when(cmd.getZoneId()).thenReturn(null);
25842589
// Simulate resolver having provided the source offering domains (the real cmd#getDomainIds() would do this)
25852590
when(cmd.getDomainIds()).thenReturn(sourceDomainIds);
25862591

0 commit comments

Comments
 (0)