### Question:
Xs2aConsentAuthorisationMapper { public CreateAuthorisationRequest mapToAuthorisationRequest(ScaStatus scaStatus, PsuIdData psuData, ScaApproach scaApproach, String tppRedirectURI, String tppNOKRedirectURI) { return Optional.ofNullable(scaStatus) .map(st -> { CreateAuthorisationRequest consentAuthorization = new CreateAuthorisationRequest(); consentAuthorization.setPsuData(psuData); consentAuthorization.setScaApproach(scaApproach); consentAuthorization.setTppRedirectURIs(tppRedirectUriMapper.mapToTppRedirectUri(tppRedirectURI,tppNOKRedirectURI)); return consentAuthorization; }) .orElse(null); }  CreateAuthorisationRequest mapToAuthorisationRequest(ScaStatus scaStatus, PsuIdData psuData, ScaApproach scaApproach, String tppRedirectURI, String tppNOKRedirectURI); UpdateAuthorisationRequest mapToAuthorisationRequest(UpdateConsentPsuDataReq updatePsuData);  }### Answer:
@Test void mapToAuthorisationRequest_CreateAuthorisationRequest() { CreateAuthorisationRequest actual = mapper.mapToAuthorisationRequest(ScaStatus.RECEIVED, PSU_ID_DATA, ScaApproach.EMBEDDED, "ok.uri", "nok.uri"); CreateAuthorisationRequest expected = jsonReader.getObjectFromFile("json/service/mapper/consent/create-authorisation-request.json", CreateAuthorisationRequest.class); assertEquals(expected, actual); }
@Test void mapToAuthorisationRequest_CreateAuthorisationRequest_scaStatusIsNull() { CreateAuthorisationRequest actual = mapper.mapToAuthorisationRequest(null, PSU_ID_DATA, ScaApproach.EMBEDDED, "ok.uri", "nok.uri"); assertNull(actual); }
@Test void mapToAuthorisationRequest_UpdateAuthorisationRequest() { UpdateConsentPsuDataReq updateAuthorisationRequest = jsonReader.getObjectFromFile("json/service/mapper/consent/update-consent-psu-data-req.json", UpdateConsentPsuDataReq.class); UpdateAuthorisationRequest actual = mapper.mapToAuthorisationRequest(updateAuthorisationRequest); UpdateAuthorisationRequest expected = jsonReader.getObjectFromFile("json/service/mapper/consent/ais-update-authorisation-request.json", UpdateAuthorisationRequest.class); assertEquals(expected, actual); }
@Test void mapToAuthorisationRequest_UpdateAuthorisationRequest_nullValue() { assertNull(mapper.mapToAuthorisationRequest(null)); }