File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
server/test/com/cloud/user Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1818
1919import java .lang .reflect .Field ;
2020import java .util .Arrays ;
21+ import java .util .ArrayList ;
2122
2223import javax .inject .Inject ;
2324
4041import org .apache .cloudstack .framework .messagebus .MessageBus ;
4142import org .apache .cloudstack .region .gslb .GlobalLoadBalancerRuleDao ;
4243
44+ import com .cloud .vm .snapshot .VMSnapshotManager ;
45+ import com .cloud .vm .snapshot .VMSnapshotVO ;
46+ import com .cloud .vm .snapshot .dao .VMSnapshotDao ;
47+
4348import com .cloud .configuration .ConfigurationManager ;
4449import com .cloud .configuration .dao .ResourceCountDao ;
4550import com .cloud .configuration .dao .ResourceLimitDao ;
@@ -177,6 +182,11 @@ public class AccountManagerImplTest {
177182 @ Mock
178183 MessageBus _messageBus ;
179184
185+ @ Mock
186+ VMSnapshotManager _vmSnapshotMgr ;
187+ @ Mock
188+ VMSnapshotDao _vmSnapshotDao ;
189+
180190 @ Mock
181191 User callingUser ;
182192 @ Mock
@@ -264,6 +274,7 @@ public void deleteUserAccount() {
264274 securityChecker .checkAccess (Mockito .any (Account .class ),
265275 Mockito .any (Domain .class )))
266276 .thenReturn (true );
277+ Mockito .when (_vmSnapshotDao .listByAccountId (Mockito .anyLong ())).thenReturn (new ArrayList <VMSnapshotVO >());
267278
268279 Assert .assertTrue (accountManager .deleteUserAccount (42 ));
269280 // assert that this was a clean delete
You can’t perform that action at this time.
0 commit comments