mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
server: fix unit test to fix build
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit dd5fb2ebd6904026e2ba0b3efcb6c382f860ffdd) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
43cf1da865
commit
3786aa0e67
@ -18,6 +18,7 @@ package com.cloud.user;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@ -40,6 +41,10 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.cloudstack.framework.messagebus.MessageBus;
|
||||
import org.apache.cloudstack.region.gslb.GlobalLoadBalancerRuleDao;
|
||||
|
||||
import com.cloud.vm.snapshot.VMSnapshotManager;
|
||||
import com.cloud.vm.snapshot.VMSnapshotVO;
|
||||
import com.cloud.vm.snapshot.dao.VMSnapshotDao;
|
||||
|
||||
import com.cloud.configuration.ConfigurationManager;
|
||||
import com.cloud.configuration.dao.ResourceCountDao;
|
||||
import com.cloud.configuration.dao.ResourceLimitDao;
|
||||
@ -177,6 +182,11 @@ public class AccountManagerImplTest {
|
||||
@Mock
|
||||
MessageBus _messageBus;
|
||||
|
||||
@Mock
|
||||
VMSnapshotManager _vmSnapshotMgr;
|
||||
@Mock
|
||||
VMSnapshotDao _vmSnapshotDao;
|
||||
|
||||
@Mock
|
||||
User callingUser;
|
||||
@Mock
|
||||
@ -264,6 +274,7 @@ public class AccountManagerImplTest {
|
||||
securityChecker.checkAccess(Mockito.any(Account.class),
|
||||
Mockito.any(Domain.class)))
|
||||
.thenReturn(true);
|
||||
Mockito.when(_vmSnapshotDao.listByAccountId(Mockito.anyLong())).thenReturn(new ArrayList<VMSnapshotVO>());
|
||||
|
||||
Assert.assertTrue(accountManager.deleteUserAccount(42));
|
||||
// assert that this was a clean delete
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user