### Question:
PisAuthorisationService { public Xs2aUpdatePisCommonPaymentPsuDataResponse updatePisAuthorisation(Xs2aUpdatePisCommonPaymentPsuDataRequest request, ScaApproach scaApproach) { String authorisationId = request.getAuthorisationId(); CmsResponse<Authorisation> pisAuthorisationResponse = authorisationServiceEncrypted.getAuthorisationById(authorisationId); if (pisAuthorisationResponse.hasError()) { ErrorHolder errorHolder = ErrorHolder.builder(ErrorType.PIS_404) .tppMessages(TppMessageInformation.of(MessageErrorCode.RESOURCE_UNKNOWN_404_NO_AUTHORISATION)) .build(); log.info("Payment-ID [{}], Authorisation-ID [{}]. Updating PIS authorisation PSU Data has failed: authorisation is not found by id.", request.getPaymentId(), request.getAuthorisationId()); return new Xs2aUpdatePisCommonPaymentPsuDataResponse(errorHolder, request.getPaymentId(), authorisationId, request.getPsuData()); } Authorisation response = pisAuthorisationResponse.getPayload(); return (Xs2aUpdatePisCommonPaymentPsuDataResponse) authorisationChainResponsibilityService.apply( new PisAuthorisationProcessorRequest(scaApproach, response.getScaStatus(), request, response)); }  CreateAuthorisationResponse createPisAuthorisation(String paymentId, PsuIdData psuData); Xs2aUpdatePisCommonPaymentPsuDataResponse updatePisAuthorisation(Xs2aUpdatePisCommonPaymentPsuDataRequest request, ScaApproach scaApproach); Xs2aUpdatePisCommonPaymentPsuDataResponse updatePisCancellationAuthorisation(Xs2aUpdatePisCommonPaymentPsuDataRequest request, ScaApproach scaApproach); CreateAuthorisationResponse createPisAuthorisationCancellation(String paymentId, PsuIdData psuData); Optional<List<String>> getCancellationAuthorisationSubResources(String paymentId); Optional<List<String>> getAuthorisationSubResources(String paymentId); Optional<ScaStatus> getAuthorisationScaStatus(String paymentId, String authorisationId); Optional<ScaStatus> getCancellationAuthorisationScaStatus(String paymentId, String authorisationId); Optional<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId); void updateAuthorisation(UpdateAuthorisationRequest request,
                                    AuthorisationProcessorResponse response); void updateCancellationAuthorisation(UpdateAuthorisationRequest request,
                                                AuthorisationProcessorResponse response);  }### Answer:
@Test void updatePisAuthorisation_success() { ArgumentCaptor<AuthorisationProcessorRequest> authorisationProcessorRequestCaptor = ArgumentCaptor.forClass(AuthorisationProcessorRequest.class); when(authorisationServiceEncrypted.getAuthorisationById(AUTHORISATION_ID)) .thenReturn(CmsResponse.<Authorisation>builder().payload(GET_PIS_AUTHORISATION_RESPONSE).build()); when(authorisationChainResponsibilityService.apply(authorisationProcessorRequestCaptor.capture())).thenReturn(STAGE_RESPONSE); Xs2aUpdatePisCommonPaymentPsuDataResponse actualResponse = pisAuthorisationService.updatePisAuthorisation(XS2A_UPDATE_PIS_COMMON_PAYMENT_PSU_DATA_REQUEST, SCA_APPROACH); assertThat(actualResponse).isEqualTo(STAGE_RESPONSE); assertThat(authorisationProcessorRequestCaptor.getValue().getServiceType()).isEqualTo(ServiceType.PIS); assertThat(authorisationProcessorRequestCaptor.getValue().getUpdateAuthorisationRequest()).isEqualTo(XS2A_UPDATE_PIS_COMMON_PAYMENT_PSU_DATA_REQUEST); assertThat(authorisationProcessorRequestCaptor.getValue().getAuthorisation()).isEqualTo(GET_PIS_AUTHORISATION_RESPONSE); }