@@ -167,7 +167,6 @@ public void disableAccount() throws ConcurrentOperationException, ResourceUnavai
167167 public void deleteUserAccount () {
168168 AccountVO account = new AccountVO ();
169169 account .setId (42l );
170- account .setState (State .DISABLED );
171170 DomainVO domain = new DomainVO ();
172171 Mockito .when (_accountDao .findById (42l )).thenReturn (account );
173172 Mockito .doNothing ().when (accountManagerImpl ).checkAccess (Mockito .any (Account .class ), Mockito .isNull (), Mockito .anyBoolean (), Mockito .any (Account .class ));
@@ -196,7 +195,6 @@ public void deleteUserAccount() {
196195 public void deleteUserAccountCleanup () {
197196 AccountVO account = new AccountVO ();
198197 account .setId (42l );
199- account .setState (State .DISABLED );
200198 DomainVO domain = new DomainVO ();
201199 Mockito .when (_accountDao .findById (42l )).thenReturn (account );
202200 Mockito .doNothing ().when (accountManagerImpl ).checkAccess (Mockito .any (Account .class ), Mockito .isNull (), Mockito .anyBoolean (), Mockito .any (Account .class ));
@@ -213,16 +211,6 @@ public void deleteUserAccountCleanup() {
213211 Mockito .verify (_accountDao , Mockito .atLeastOnce ()).markForCleanup (Mockito .eq (42l ));
214212 }
215213
216- @ Test (expected = CloudRuntimeException .class )
217- public void deleteUserAccountEnabled () {
218- AccountVO account = new AccountVO ();
219- account .setId (42l );
220- account .setState (State .ENABLED );
221- Mockito .when (_accountDao .findById (42l )).thenReturn (account );
222- Mockito .doNothing ().when (accountManagerImpl ).checkAccess (Mockito .any (Account .class ), Mockito .isNull (), Mockito .anyBoolean (), Mockito .any (Account .class ));
223- accountManagerImpl .deleteUserAccount (42l );
224- }
225-
226214 @ Test (expected = InvalidParameterValueException .class )
227215 public void deleteUserAccountTestIfAccountIdIsEqualToCallerIdShouldThrowException () {
228216 try (MockedStatic <CallContext > callContextMocked = Mockito .mockStatic (CallContext .class )) {
@@ -246,11 +234,7 @@ public void deleteUserAccountTestIfAccountIdIsNotEqualToCallerAccountIdShouldNot
246234 callContextMocked .when (CallContext ::current ).thenReturn (callContextMock );
247235 long accountId = 1L ;
248236
249- AccountVO account = new AccountVO ();
250- account .setId (accountId );
251- account .setState (State .DISABLED );
252237 Mockito .doReturn (accountVoMock ).when (callContextMock ).getCallingAccount ();
253- Mockito .doReturn (account ).when (_accountDao ).findById (accountId );
254238 Mockito .doReturn (2L ).when (accountVoMock ).getId ();
255239 Mockito .doReturn (true ).when (accountManagerImpl ).isDeleteNeeded (Mockito .any (), Mockito .anyLong (), Mockito .any ());
256240 Mockito .doReturn (new ArrayList <Long >()).when (_projectAccountDao ).listAdministratedProjectIds (Mockito .anyLong ());
0 commit comments