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:
Rohit Yadav 2015-02-27 19:18:18 +05:30
parent 43cf1da865
commit 3786aa0e67

View File

@ -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