### Question:
DecoupledPiisAuthorizationService implements PiisAuthorizationService { @Override public AuthorisationProcessorResponse updateConsentPsuData(UpdateAuthorisationRequest request, AuthorisationProcessorResponse response) { if (response.hasError()) { log.info("Consent-ID [{}], Authentication-ID [{}], PSU-ID [{}]. Update consent authorisation has failed. Error msg: {}.", request.getBusinessObjectId(), request.getAuthorisationId(), request.getPsuData().getPsuId(), response.getErrorHolder()); } else { piisConsentService.updateConsentAuthorisation(piisConsentMapper.mapToUpdateConsentPsuDataReq(request, response)); } return response; }  @Override Optional<CreateConsentAuthorizationResponse> createConsentAuthorization(PsuIdData psuData, String consentId); @Override AuthorisationProcessorResponse updateConsentPsuData(UpdateAuthorisationRequest request, AuthorisationProcessorResponse response); @Override Optional<Authorisation> getConsentAuthorizationById(String authorisationId); @Override Optional<ScaStatus> getAuthorisationScaStatus(String consentId, String authorisationId); @Override ScaApproach getScaApproachServiceType();  }### Answer:
@Test void updateConsentPsuData() { UpdateConsentPsuDataReq authorisationRequest = buildUpdateConsentPsuDataReq(); AuthorisationProcessorResponse processorResponse = new AuthorisationProcessorResponse(); UpdateConsentPsuDataReq mappedUpdatePsuDataRequest = new UpdateConsentPsuDataReq(); when(piisConsentMapper.mapToUpdateConsentPsuDataReq(authorisationRequest, processorResponse)) .thenReturn(mappedUpdatePsuDataRequest); AuthorisationProcessorResponse actualResponse = decoupledPiisAuthorizationService.updateConsentPsuData(authorisationRequest, processorResponse); assertEquals(processorResponse, actualResponse); verify(piisConsentService).updateConsentAuthorisation(mappedUpdatePsuDataRequest); }
@Test void updateConsentPsuData_errorResponse() { UpdateConsentPsuDataReq authorisationRequest = buildUpdateConsentPsuDataReq(); AuthorisationProcessorResponse processorResponse = buildAuthorisationProcessorResponseWithError(); AuthorisationProcessorResponse actualResponse = decoupledPiisAuthorizationService.updateConsentPsuData(authorisationRequest, processorResponse); assertEquals(processorResponse, actualResponse); verify(piisConsentService, never()).updateConsentAuthorisation(any()); }