### Question:
Xs2aAisConsentMapper { public UpdateConsentPsuDataReq mapToUpdateConsentPsuDataReq(UpdateAuthorisationRequest request, AuthorisationProcessorResponse response) { return Optional.ofNullable(response) .map(data -> { UpdateConsentPsuDataReq req = new UpdateConsentPsuDataReq(); req.setPsuData(response.getPsuData()); req.setConsentId(request.getBusinessObjectId()); req.setAuthorizationId(request.getAuthorisationId()); req.setAuthenticationMethodId(Optional.ofNullable(data.getChosenScaMethod()) .map(AuthenticationObject::getAuthenticationMethodId) .orElse(null)); req.setScaAuthenticationData(request.getScaAuthenticationData()); req.setScaStatus(data.getScaStatus()); req.setAuthorisationType(AuthorisationType.CONSENT); return req; }) .orElse(null); }  SpiAccountConsent mapToSpiAccountConsent(AisConsent aisConsent); UpdateConsentPsuDataReq mapToUpdateConsentPsuDataReq(UpdateAuthorisationRequest request,
                                                                AuthorisationProcessorResponse response); SpiScaConfirmation mapToSpiScaConfirmation(UpdateAuthorisationRequest request, PsuIdData psuData); CmsConsent mapToCmsConsent(CreateConsentReq request, PsuIdData psuData, TppInfo tppInfo, int allowedFrequencyPerDay); AisConsent mapToAisConsent(CmsConsent ais);  }### Answer:
@Test void mapToSpiUpdateConsentPsuDataReq() { UpdateConsentPsuDataReq updateAuthorisationRequest = jsonReader.getObjectFromFile("json/service/mapper/consent/update-consent-psu-data-req.json", UpdateConsentPsuDataReq.class); AuthorisationProcessorResponse authorisationProcessorResponse = jsonReader.getObjectFromFile("json/service/mapper/consent/authorisation-processor-response2.json", AuthorisationProcessorResponse.class); UpdateConsentPsuDataReq actual = mapper.mapToUpdateConsentPsuDataReq(updateAuthorisationRequest, authorisationProcessorResponse); UpdateConsentPsuDataReq expected = jsonReader.getObjectFromFile("json/service/mapper/consent/update-consent-psu-data-req-mapped.json", UpdateConsentPsuDataReq.class); assertEquals(expected, actual); }
@Test void mapToSpiUpdateConsentPsuDataReq_nullValue() { assertNull(mapper.mapToUpdateConsentPsuDataReq(null, null)); }