### Question:
Xs2aToSpiPiisConsentMapper { @Mapping(target = "account", expression = "java(toSpiAccountReference(piisConsent.getAccountReference()))") @Mapping(target = "cardExpiryDate", source = "consentData.cardExpiryDate") @Mapping(target = "cardInformation", source = "consentData.cardInformation") @Mapping(target = "cardNumber", source = "consentData.cardNumber") @Mapping(target = "psuData", source = "psuIdDataList") @Mapping(target = "registrationInformation", source = "consentData.registrationInformation") @Mapping(target = "requestDateTime", source = "creationTimestamp") @Mapping(target = "tppAuthorisationNumber", source = "consentTppInformation.tppInfo.authorisationNumber") public abstract SpiPiisConsent mapToSpiPiisConsent(PiisConsent piisConsent);  @Mapping(target = "account", expression = "java(toSpiAccountReference(piisConsent.getAccountReference()))") @Mapping(target = "cardExpiryDate", source = "consentData.cardExpiryDate") @Mapping(target = "cardInformation", source = "consentData.cardInformation") @Mapping(target = "cardNumber", source = "consentData.cardNumber") @Mapping(target = "psuData", source = "psuIdDataList") @Mapping(target = "registrationInformation", source = "consentData.registrationInformation") @Mapping(target = "requestDateTime", source = "creationTimestamp") @Mapping(target = "tppAuthorisationNumber", source = "consentTppInformation.tppInfo.authorisationNumber") abstract SpiPiisConsent mapToSpiPiisConsent(PiisConsent piisConsent); SpiScaConfirmation toSpiScaConfirmation(UpdateAuthorisationRequest request, PsuIdData psuData);  }### Answer:
@Test void mapToSpiPiisConsent() { PiisConsent xs2aConsent = jsonReader.getObjectFromFile("json/service/mapper/spi_xs2a_mappers/piis/piis-consent.json", PiisConsent.class); SpiPiisConsent expectedSpiConsent = jsonReader.getObjectFromFile("json/service/mapper/spi_xs2a_mappers/piis/spi-piis-consent.json", SpiPiisConsent.class); SpiPiisConsent result = xs2aToSpiPiisConsentMapper.mapToSpiPiisConsent(xs2aConsent); assertEquals(expectedSpiConsent, result); }
@Test void mapToSpiPiisConsent_null() { SpiPiisConsent result = xs2aToSpiPiisConsentMapper.mapToSpiPiisConsent(null); assertNull(result); }