### Question:
Xs2aPisCommonPaymentMapper { public UpdateAuthorisationRequest mapToUpdateAuthorisationRequest(AuthorisationProcessorResponse response, AuthorisationType authorisationType) { return Optional.ofNullable(response) .map(data -> { UpdateAuthorisationRequest req = new UpdateAuthorisationRequest(); req.setPsuData(((Xs2aUpdatePisCommonPaymentPsuDataResponse) response).getPsuData()); req.setAuthenticationMethodId(Optional.ofNullable(data.getChosenScaMethod()) .map(AuthenticationObject::getAuthenticationMethodId) .orElse(null)); req.setScaStatus(data.getScaStatus()); req.setAuthorisationType(authorisationType); return req; }) .orElse(null); }  Optional<Xs2aCreatePisAuthorisationResponse> mapToXsa2CreatePisAuthorisationResponse(CreateAuthorisationResponse response, PaymentType paymentType); Optional<Xs2aCreatePisCancellationAuthorisationResponse> mapToXs2aCreatePisCancellationAuthorisationResponse(CreateAuthorisationResponse response, PaymentType paymentType); Xs2aPisCommonPayment mapToXs2aPisCommonPayment(CreatePisCommonPaymentResponse response, PsuIdData psuData); UpdateAuthorisationRequest mapToUpdateAuthorisationRequest(AuthorisationProcessorResponse response, AuthorisationType authorisationType); SpiScaConfirmation buildSpiScaConfirmation(Xs2aUpdatePisCommonPaymentPsuDataRequest request, String consentId, String paymentId, PsuIdData psuData);  }### Answer:
@Test void mapToUpdateAuthorisationRequest() { Xs2aUpdatePisCommonPaymentPsuDataResponse authorisationProcessorResponse = jsonReader.getObjectFromFile("json/service/mapper/consent/authorisation-processor-response.json", Xs2aUpdatePisCommonPaymentPsuDataResponse.class); UpdateAuthorisationRequest actual = xs2aPisCommonPaymentMapper.mapToUpdateAuthorisationRequest(authorisationProcessorResponse, AuthorisationType.PIS_CREATION); UpdateAuthorisationRequest expected = jsonReader.getObjectFromFile("json/service/mapper/consent/update-authorisation-request.json", UpdateAuthorisationRequest.class); assertEquals(expected, actual); }
@Test void mapToUpdateAuthorisationRequest_nullValue() { assertNull(xs2aPisCommonPaymentMapper.mapToUpdateAuthorisationRequest(null, AuthorisationType.PIS_CREATION)); }