@Test
public void deleteUserAccount() {

    AccountVO account = new AccountVO();
    account.setId(42l);
    DomainVO domain = new DomainVO();
    Mockito.when(_accountDao.findById(42l)).thenReturn(account);
    Mockito.when(
            securityChecker.checkAccess(Mockito.any(Account.class),
                Mockito.any(ControlledEntity.class), Mockito.any(AccessType.class),
                Mockito.anyString()))
            .thenReturn(true);
    Mockito.when(_accountDao.remove(42l)).thenReturn(true);
    Mockito.when(_configMgr.releaseAccountSpecificVirtualRanges(42l))
            .thenReturn(true);
    Mockito.when(_domainMgr.getDomain(Mockito.anyLong())).thenReturn(domain);
    Mockito.when(
            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
    Mockito.verify(_accountDao, Mockito.never()).markForCleanup(
            Mockito.eq(42l));
}