### Question:
AisAuthorisationProcessorServiceImpl extends ConsentAuthorisationProcessorService<AisConsent> { @Override public void updateAuthorisation(AuthorisationProcessorRequest request, AuthorisationProcessorResponse response) { AisAuthorizationService authorizationService = getService(request.getScaApproach()); authorizationService.updateConsentPsuData(request.getUpdateAuthorisationRequest(), response); } AisAuthorisationProcessorServiceImpl(Xs2aAuthorisationService authorisationService,
                                                SpiContextDataProvider spiContextDataProvider,
                                                SpiAspspConsentDataProviderFactory aspspConsentDataProviderFactory,
                                                SpiErrorMapper spiErrorMapper,
                                                Xs2aToSpiPsuDataMapper psuDataMapper,
                                                List<AisAuthorizationService> services,
                                                Xs2aAisConsentService aisConsentService,
                                                AisConsentSpi aisConsentSpi,
                                                Xs2aAisConsentMapper aisConsentMapper,
                                                CommonDecoupledAisService commonDecoupledAisService,
                                                AisScaAuthorisationService aisScaAuthorisationService); @Override void updateAuthorisation(AuthorisationProcessorRequest request, AuthorisationProcessorResponse response);  }### Answer:
@Test void updateAuthorisation_shouldUpdateWithCorrectService() { UpdateAuthorisationRequest updateAuthorisationRequest = new UpdateConsentPsuDataReq(); AuthorisationProcessorRequest processorRequest = buildAuthorisationProcessorRequest(ScaStatus.PSUIDENTIFIED, updateAuthorisationRequest, authorisation); AuthorisationProcessorResponse processorResponse = new AuthorisationProcessorResponse(); when(embeddedAisAuthorisationService.getScaApproachServiceType()).thenReturn(ScaApproach.EMBEDDED); aisAuthorisationProcessorService.updateAuthorisation(processorRequest, processorResponse); verify(embeddedAisAuthorisationService).updateConsentPsuData(updateAuthorisationRequest, processorResponse); }
@Test void updateAuthorisation_withNoAuthorisationServiceForApproach_shouldThrowException() { UpdateAuthorisationRequest updateAuthorisationRequest = new UpdateConsentPsuDataReq(); AuthorisationProcessorRequest processorRequest = new AuthorisationProcessorRequest(ServiceType.AIS, ScaApproach.REDIRECT, ScaStatus.PSUIDENTIFIED, updateAuthorisationRequest, authorisation); AuthorisationProcessorResponse processorResponse = new AuthorisationProcessorResponse(); assertThrows(IllegalArgumentException.class, () -> aisAuthorisationProcessorService.updateAuthorisation(processorRequest, processorResponse)); verify(embeddedAisAuthorisationService, never()).updateConsentPsuData(any(UpdateAuthorisationRequest.class), any(AuthorisationProcessorResponse.class)); }