### Question:
CmsPsuAisController implements CmsPsuAisApi { @Override public ResponseEntity<List<CmsAisAccountConsent>> getConsentsForPsu(String psuId, String psuIdType, String psuCorporateId, String psuCorporateIdType, String instanceId) { PsuIdData psuIdData = getPsuIdData(psuId, psuIdType, psuCorporateId, psuCorporateIdType); return new ResponseEntity<>(cmsPsuAisService.getConsentsForPsu(psuIdData, instanceId), HttpStatus.OK); }  @Override ResponseEntity<Object> updatePsuDataInConsent(String consentId, String authorisationId, String instanceId, PsuIdData psuIdData); @Override ResponseEntity<Object> updateAuthorisationStatus(String consentId, String status, String authorisationId, String psuId, String psuIdType, String psuCorporateId, String psuCorporateIdType, String instanceId, AuthenticationDataHolder authenticationDataHolder); @Override ResponseEntity<Boolean> confirmConsent(String consentId, String instanceId); @Override ResponseEntity<Boolean> rejectConsent(String consentId, String instanceId); @Override ResponseEntity<List<CmsAisAccountConsent>> getConsentsForPsu(String psuId, String psuIdType, String psuCorporateId, String psuCorporateIdType, String instanceId); @Override ResponseEntity<Boolean> revokeConsent(String consentId, String instanceId); @Override ResponseEntity<Boolean> authorisePartiallyConsent(String consentId, String instanceId); @Override ResponseEntity<CmsAisConsentResponse> getConsentIdByRedirectId(String redirectId, String instanceId); @Override ResponseEntity<CmsAisAccountConsent> getConsentByConsentId(String consentId, String psuId, String psuIdType, String psuCorporateId, String psuCorporateIdType, String instanceId); @Override ResponseEntity<CmsPsuAuthorisation> getAuthorisationByAuthorisationId(String authorisationId, String instanceId); @Override ResponseEntity<Void> putAccountAccessInConsent(String consentId, CmsAisConsentAccessRequest accountAccessRequest, String instanceId); @Override ResponseEntity<List<CmsAisPsuDataAuthorisation>> psuDataAuthorisations(String consentId, String instanceId);  }### Answer:
@Test void getConsentsForPsu_withValidRequest_shouldReturnOk() throws Exception { String aisConsentListString = jsonReader.getStringFromFile("json/ais/response/ais-consent-list.json"); List<CmsAisAccountConsent> cmsAisAccountConsentList = jsonReader.getListFromString(aisConsentListString, CmsAisAccountConsent.class); when(cmsPsuAisService.getConsentsForPsu(PSU_ID_DATA, INSTANCE_ID)) .thenReturn(cmsAisAccountConsentList); mockMvc.perform(get("/psu-api/v1/ais/consent/consents") .headers(INSTANCE_ID_HEADERS) .headers(PSU_HEADERS)) .andExpect(status().isOk()) .andExpect(content().json(aisConsentListString)); verify(cmsPsuAisService).getConsentsForPsu(PSU_ID_DATA, INSTANCE_ID); }
@Test void getConsentsForPsu_withFalseServiceResponse_shouldReturnOk() throws Exception { when(cmsPsuAisService.getConsentsForPsu(PSU_ID_DATA, INSTANCE_ID)) .thenReturn(Collections.emptyList()); mockMvc.perform(get("/psu-api/v1/ais/consent/consents") .headers(INSTANCE_ID_HEADERS) .headers(PSU_HEADERS)) .andExpect(status().isOk()) .andExpect(content().json("[]")); verify(cmsPsuAisService).getConsentsForPsu(PSU_ID_DATA, INSTANCE_ID); }