### Question:
CardAccountController implements CardAccountsApi { @Override public ResponseEntity getCardAccount(UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) { ResponseObject<Xs2aCardAccountListHolder> accountList = cardAccountService.getCardAccountList(consentID, trimEndingSlash(request.getRequestURI())); return accountList.hasError() ? responseErrorMapper.generateErrorResponse(accountList.getError()) : responseMapper.ok(accountList, cardAccountModelMapper::mapToCardAccountList); }  @Override ResponseEntity getCardAccount(UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation); @Override ResponseEntity getCardAccountBalances(String accountId, UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation); @Override ResponseEntity getCardAccountTransactionList(String accountId, String bookingStatus, UUID xRequestID, String consentID, LocalDate dateFrom, LocalDate dateTo, String entryReferenceFrom, Boolean deltaList, Boolean withBalance, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation); @Override ResponseEntity readCardAccount(String accountId, UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation);  }### Answer:
@Test void getAccountList_ok() throws IOException { when(cardAccountService.getCardAccountList(anyString(), anyString())).thenReturn(getXs2aCardAccountListHolder()); when(request.getRequestURI()).thenReturn(REQUEST_URI); CardAccountList expectedResult = createCardAccountDetailsList().getBody(); doReturn(new ResponseEntity<>(createCardAccountDetailsList().getBody(), HttpStatus.OK)) .when(responseMapper).ok(any(), any()); CardAccountList result = (CardAccountList) cardAccountController.getCardAccount(null, CONSENT_ID, null, null, null, null, null, null, null, null, null, null, null, null, null).getBody(); assertThat(result).isEqualTo(expectedResult); }
@Test void getAccountList_wrongId_fail() { when(cardAccountService.getCardAccountList(anyString(), anyString())).thenReturn(getXs2aCardAccountListHolder()); when(request.getRequestURI()).thenReturn(REQUEST_URI); ResponseObject<Xs2aCardAccountListHolder> responseEntity = getXs2aCardAccountListHolderWithError(); when(cardAccountService.getCardAccountList(WRONG_CONSENT_ID, REQUEST_URI)) .thenReturn(responseEntity); when(responseErrorMapper.generateErrorResponse(MESSAGE_ERROR_AIS_404)) .thenReturn(new ResponseEntity<>(HttpStatus.NOT_FOUND)); ResponseEntity<?> result = cardAccountController.getCardAccount(null, WRONG_CONSENT_ID, null, null, null, null, null, null, null, null, null, null, null, null, null); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); }