Skip to content

Commit 1e1ceed

Browse files
author
Nicole Schmidt
committed
Add missing stubbing and remove unnecessary ones
1 parent 05cacfe commit 1e1ceed

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/test/java/com/cloud/user/AccountManagerImplTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,10 @@ public void testAuthenticateUser() throws UnknownHostException {
367367
}
368368

369369
@Test(expected = PermissionDeniedException.class)
370-
public void testgetUserCmd() {
370+
public void testGetUserCmd() {
371371
CallContext.register(callingUser, callingAccount); // Calling account is user account i.e normal account
372372
Mockito.when(_getkeyscmd.getId()).thenReturn(1L);
373373
Mockito.when(accountManagerImpl.getActiveUser(1L)).thenReturn(userVoMock);
374-
Mockito.when(userAccountDaoMock.findById(1L)).thenReturn(userAccountVO);
375374

376375
Mockito.lenient().when(callingUser.getAccountId()).thenReturn(1L);
377376
Mockito.lenient().when(_accountDao.findById(1L)).thenReturn(callingAccount);
@@ -387,9 +386,7 @@ public void testGetUserKeysCmdDomainAdminRootAdminUser() {
387386
CallContext.register(callingUser, callingAccount);
388387
Mockito.when(_getkeyscmd.getId()).thenReturn(2L);
389388
Mockito.when(accountManagerImpl.getActiveUser(2L)).thenReturn(userVoMock);
390-
Mockito.when(userAccountDaoMock.findById(2L)).thenReturn(userAccountVO);
391-
Mockito.when(userAccountVO.getAccountId()).thenReturn(2L);
392-
Mockito.when(userDetailsDaoMock.listDetailsKeyPairs(Mockito.anyLong())).thenReturn(null);
389+
Mockito.when(userVoMock.getAccountId()).thenReturn(2L);
393390

394391
// Queried account - admin account
395392
AccountVO adminAccountMock = Mockito.mock(AccountVO.class);

0 commit comments

Comments
 (0)