@Test
public void disableAccount() throws ConcurrentOperationException,
        ResourceUnavailableException {

    AccountVO account = new AccountVO();
    account.setState(State.enabled);
    Mockito.when(_accountDao.findById(42l)).thenReturn(account);
    Mockito.when(_accountDao.createForUpdate()).thenReturn(new AccountVO());
    Mockito.when(
            _accountDao.update(Mockito.eq(42l),
                    Mockito.any(AccountVO.class))).thenReturn(true);
    Mockito.when(_vmDao.listByAccountId(42l)).thenReturn(
            Arrays.asList(Mockito.mock(VMInstanceVO.class)));
    Assert.assertTrue(accountManager.disableAccount(42));
    Mockito.verify(_accountDao, Mockito.atLeastOnce()).update(
            Mockito.eq(42l), Mockito.any(AccountVO.class));
}