### Question:
AspspConsentDataPsuApiController implements AspspConsentDataPsuApi { @Override public ResponseEntity<Void> updateAspspConsentData(String encryptedConsentId, CmsAspspConsentDataBase64 request) { byte[] data = Optional.ofNullable(request.getAspspConsentDataBase64()) .map(Base64.getDecoder()::decode) .orElse(null); AspspConsentData aspspConsentData = new AspspConsentData(data, encryptedConsentId); boolean updated = aspspDataService.updateAspspConsentData(aspspConsentData); if (!updated) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return ResponseEntity.ok().build(); }  @Override ResponseEntity<CmsAspspConsentDataBase64> getAspspConsentData(String encryptedConsentId); @Override ResponseEntity<Void> updateAspspConsentData(String encryptedConsentId, CmsAspspConsentDataBase64 request); @Override ResponseEntity<Void> deleteAspspConsentData(String encryptedConsentId);  }### Answer:
@Test void updateAspspConsentData_withValidRequest_shouldReturnOk() throws Exception { String cmsAspspConsentDataBase64Json = jsonReader.getStringFromFile("json/aspsp/cms-aspsp-consent-data-base64.json"); AspspConsentData aspspConsentData = new AspspConsentData(ASPSP_CONSENT_DATA.getBytes(), CONSENT_ID); when(aspspDataService.updateAspspConsentData(aspspConsentData)) .thenReturn(true); mockMvc.perform(put("/psu-api/v1/aspsp-consent-data/consents/{consent-id}", CONSENT_ID) .contentType(MediaType.APPLICATION_JSON) .content(cmsAspspConsentDataBase64Json)) .andExpect(status().isOk()) .andExpect(content().bytes(EMPTY_BODY)); }
@Test void updateAspspConsentData_withFalseServiceResponse_shouldReturnNotFound() throws Exception { String cmsAspspConsentDataBase64Json = jsonReader.getStringFromFile("json/aspsp/cms-aspsp-consent-data-base64.json"); AspspConsentData aspspConsentData = new AspspConsentData(ASPSP_CONSENT_DATA.getBytes(), CONSENT_ID); when(aspspDataService.updateAspspConsentData(aspspConsentData)) .thenReturn(false); mockMvc.perform(put("/psu-api/v1/aspsp-consent-data/consents/{consent-id}", CONSENT_ID) .contentType(MediaType.APPLICATION_JSON) .content(cmsAspspConsentDataBase64Json)) .andExpect(status().isNotFound()) .andExpect(content().bytes(EMPTY_BODY)); }