### Question:
Xs2aAisConsentMapper { public SpiScaConfirmation mapToSpiScaConfirmation(UpdateAuthorisationRequest request, PsuIdData psuData) { SpiScaConfirmation accountConfirmation = new SpiScaConfirmation(); accountConfirmation.setConsentId(request.getBusinessObjectId()); accountConfirmation.setPsuId(Optional.ofNullable(psuData).map(PsuIdData::getPsuId).orElse(null)); accountConfirmation.setTanNumber(request.getScaAuthenticationData()); return accountConfirmation; }  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 mapToSpiScaConfirmation() { UpdateConsentPsuDataReq request = new UpdateConsentPsuDataReq(); request.setConsentId(CONSENT_ID); request.setScaAuthenticationData("123456"); SpiScaConfirmation spiScaConfirmation = mapper.mapToSpiScaConfirmation(request, PSU_ID_DATA); assertEquals(CONSENT_ID, spiScaConfirmation.getConsentId()); assertEquals("psuId", spiScaConfirmation.getPsuId()); assertEquals("123456", spiScaConfirmation.getTanNumber()); }
@Test void mapToSpiScaConfirmation_psuIdDataIsNull() { SpiScaConfirmation spiScaConfirmation = mapper.mapToSpiScaConfirmation(new UpdateConsentPsuDataReq(), null); assertNotNull(spiScaConfirmation); assertNull(spiScaConfirmation.getPsuId()); }