125125import static org .junit .Assert .assertTrue ;
126126import static org .junit .Assert .fail ;
127127import static org .mockito .ArgumentMatchers .any ;
128+ import static org .mockito .ArgumentMatchers .anyLong ;
129+ import static org .mockito .ArgumentMatchers .anyString ;
128130import static org .mockito .Mockito .doNothing ;
129131import static org .mockito .Mockito .doReturn ;
130132import 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