### Question:
PisAuthorisationProcessorServiceImpl extends PaymentBaseAuthorisationProcessorService { @Override public AuthorisationProcessorResponse doScaReceived(AuthorisationProcessorRequest authorisationProcessorRequest) { Xs2aUpdatePisCommonPaymentPsuDataRequest request = (Xs2aUpdatePisCommonPaymentPsuDataRequest) authorisationProcessorRequest.getUpdateAuthorisationRequest(); return request.isUpdatePsuIdentification() ? applyIdentification(authorisationProcessorRequest) : applyAuthorisation(authorisationProcessorRequest); } PisAuthorisationProcessorServiceImpl(List<PisScaAuthorisationService> services,
                                                Xs2aToSpiPaymentMapper xs2aToSpiPaymentMapper, PisExecutePaymentService pisExecutePaymentService,
                                                PisAspspDataService pisAspspDataService, Xs2aPisCommonPaymentMapper xs2aPisCommonPaymentMapper,
                                                SpiContextDataProvider spiContextDataProvider, SpiErrorMapper spiErrorMapper,
                                                SpiAspspConsentDataProviderFactory aspspConsentDataProviderFactory,
                                                Xs2aUpdatePaymentAfterSpiService updatePaymentAfterSpiService,
                                                Xs2aAuthorisationService xs2aAuthorisationService,
                                                Xs2aPisCommonPaymentService xs2aPisCommonPaymentService,
                                                PaymentAuthorisationSpi paymentAuthorisationSpi,
                                                PisCommonDecoupledService pisCommonDecoupledService,
                                                Xs2aToSpiPsuDataMapper xs2aToSpiPsuDataMapper,
                                                CurrencyConversionInfoSpi currencyConversionInfoSpi,
                                                SpiToXs2aCurrencyConversionInfoMapper spiToXs2aCurrencyConversionInfoMapper); @Override void updateAuthorisation(AuthorisationProcessorRequest request, AuthorisationProcessorResponse response); @Override AuthorisationProcessorResponse doScaReceived(AuthorisationProcessorRequest authorisationProcessorRequest); @Override AuthorisationProcessorResponse doScaExempted(AuthorisationProcessorRequest authorisationProcessorRequest);  }### Answer:
@Test void doScaReceived_identification_success() { SpiAmount spiAmount = new SpiAmount(Currency.getInstance("EUR"), BigDecimal.valueOf(34)); SpiCurrencyConversionInfo spiCurrencyConversionInfo = new SpiCurrencyConversionInfo(spiAmount, spiAmount, spiAmount, spiAmount); when(currencyConversionInfoSpi.getCurrencyConversionInfo(any(), any(), any(), any())) .thenReturn(SpiResponse.<SpiCurrencyConversionInfo>builder() .payload(spiCurrencyConversionInfo) .build()); AuthorisationProcessorResponse actual = pisAuthorisationProcessorService.doScaReceived(buildIdentificationAuthorisationProcessorRequest()); assertNotNull(actual); assertNull(actual.getErrorHolder()); assertTrue(actual instanceof Xs2aUpdatePisCommonPaymentPsuDataResponse); assertThat(actual.getScaStatus()).isEqualTo(ScaStatus.PSUIDENTIFIED); assertThat(actual.getAuthorisationId()).isEqualTo(TEST_AUTHORISATION_ID); assertThat(actual.getPaymentId()).isEqualTo(TEST_PAYMENT_ID); assertThat(actual.getPsuData()).isEqualTo(TEST_PSU_DATA); }
@Test void doScaReceived_identification_no_psu_failure() { AuthorisationProcessorRequest authorisationProcessorRequest = buildIdentificationAuthorisationProcessorRequest(); ((Xs2aUpdatePisCommonPaymentPsuDataRequest) authorisationProcessorRequest.getUpdateAuthorisationRequest()).setPsuData(null); AuthorisationProcessorResponse actual = pisAuthorisationProcessorService.doScaReceived(authorisationProcessorRequest); assertNotNull(actual); assertNotNull(actual.getErrorHolder()); }