### Question:
TppAccountsController implements TppAccountsRestApi { @Override public ResponseEntity<List<AccountDetailsTO>> getAllAccounts() { return accountMgmtStaffRestClient.getListOfAccounts(); }  @Override ResponseEntity<Void> createAccount(String userId, DepositAccount account); @Override ResponseEntity<Void> updateAccountAccess(AccountAccess accountAccess); @Override ResponseEntity<List<AccountDetailsTO>> getAllAccounts(); @Override ResponseEntity<CustomPageImpl<AccountDetailsTO>> getAllAccounts(String queryParam, int page, int size); @Override ResponseEntity<AccountDetailsTO> getAccountDetailsByIban(String iban); @Override ResponseEntity<AccountDetailsTO> getSingleAccount(String accountId); @Override ResponseEntity<AccountReport> accountReport(String accountId); @Override ResponseEntity<Void> depositCash(String accountId, AmountTO amount); @Override ResponseEntity<Resource> downloadAccountTemplate(); @Override ResponseEntity<Boolean> changeStatus(String accountId);  }### Answer:
@Test void getAllAccounts() { when(accountMgmtStaffRestClient.getListOfAccounts()).thenAnswer(i -> ResponseEntity.ok(Collections.singletonList(getAccountDetailsTO()))); ResponseEntity<List<AccountDetailsTO>> response = accountsController.getAllAccounts(); assertThat(response.getStatusCode().is2xxSuccessful()).isTrue(); assertEquals(Objects.requireNonNull(response.getBody()).get(0), getAccountDetailsTO()); }
@Test void getAllAccountsPaged() { when(accountMgmtStaffRestClient.getListOfAccountsPaged(any(), anyInt(), anyInt())).thenAnswer(i -> ResponseEntity.ok(getCustomPageImpl())); ResponseEntity<CustomPageImpl<AccountDetailsTO>> response = accountsController.getAllAccounts(IBAN, 0, 25); assertThat(response.getStatusCode().is2xxSuccessful()).isTrue(); }