File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
server/src/test/java/com/cloud/user Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2929import org .apache .cloudstack .framework .messagebus .PublishScope ;
3030import org .apache .cloudstack .network .RoutedIpv4Manager ;
3131import org .apache .cloudstack .region .RegionManager ;
32+ import org .apache .commons .collections .CollectionUtils ;
3233import org .junit .Assert ;
3334import org .junit .Before ;
3435import org .junit .Test ;
6869import com .cloud .utils .db .SearchCriteria ;
6970import com .cloud .utils .exception .CloudRuntimeException ;
7071import com .cloud .utils .net .NetUtils ;
72+ import com .cloud .vm .dao .VMInstanceDao ;
7173
7274
7375@ RunWith (MockitoJUnitRunner .class )
@@ -123,6 +125,8 @@ public class DomainManagerImplTest {
123125 Account adminAccount ;
124126 @ Mock
125127 GlobalLock lock ;
128+ @ Mock
129+ VMInstanceDao vmInstanceDao ;
126130
127131 List <AccountVO > domainAccountsForCleanup ;
128132 List <Long > domainNetworkIds ;
@@ -309,7 +313,7 @@ public void deleteDomainCleanup() {
309313 Mockito .when (_resourceCountDao .removeEntriesByOwner (Mockito .anyLong (), Mockito .eq (ResourceOwnerType .Domain ))).thenReturn (1l );
310314 Mockito .when (_resourceLimitDao .removeEntriesByOwner (Mockito .anyLong (), Mockito .eq (ResourceOwnerType .Domain ))).thenReturn (1l );
311315 Mockito .when (_configMgr .releaseDomainSpecificVirtualRanges (Mockito .any ())).thenReturn (true );
312-
316+ Mockito . when ( vmInstanceDao . listDeleteProtectedVmsByDomainIds ( Mockito . any ())). thenReturn ( Collections . emptyList ());
313317 try {
314318 Assert .assertTrue (domainManager .deleteDomain (20l , true ));
315319 } finally {
You can’t perform that action at this time.
0 commit comments