### Question:
ConsentAspectService extends BaseAspectService<ConsentController> { public ResponseObject<AuthorisationResponse> invokeCreatePiisAuthorisationAspect(ResponseObject<AuthorisationResponse> result) { if (!result.hasError()) { if (result.getBody() instanceof UpdateConsentPsuDataResponse) { UpdateConsentPsuDataResponse body = (UpdateConsentPsuDataResponse) result.getBody(); body.setLinks(buildLinksForUpdateConsentResponse(body)); } else if (result.getBody() instanceof CreateConsentAuthorizationResponse) { CreateConsentAuthorizationResponse body = (CreateConsentAuthorizationResponse) result.getBody(); body.setLinks(new CreatePiisAuthorisationLinks(getHttpUrl(), body, scaApproachResolver, redirectLinkBuilder, redirectIdService, getScaRedirectFlow(), isAuthorisationConfirmationRequestMandated(), requestProviderService.getInstanceId())); } } return result; } @Autowired  ConsentAspectService(ScaApproachResolver scaApproachResolver,
                                AuthorisationMethodDecider authorisationMethodDecider,
                                RedirectLinkBuilder redirectLinkBuilder,
                                AspspProfileServiceWrapper aspspProfileServiceWrapper,
                                RedirectIdService redirectIdService,
                                RequestProviderService requestProviderService); ResponseObject<CreateConsentResponse> invokeCreateAccountConsentAspect(ResponseObject<CreateConsentResponse> result,
                                                                                  boolean explicitPreferred); ResponseObject<AuthorisationResponse> invokeCreateConsentPsuDataAspect(ResponseObject<AuthorisationResponse> result); ResponseObject<UpdateConsentPsuDataResponse> invokeUpdateConsentPsuDataAspect(ResponseObject<UpdateConsentPsuDataResponse> result); ResponseObject<UpdateConsentPsuDataResponse> invokeUpdatePiisConsentPsuDataAspect(ResponseObject<UpdateConsentPsuDataResponse> result); ResponseObject<Xs2aConfirmationOfFundsResponse> createPiisConsentWithResponse(ResponseObject<Xs2aConfirmationOfFundsResponse> result, boolean explicitPreferred); ResponseObject<AuthorisationResponse> invokeCreatePiisAuthorisationAspect(ResponseObject<AuthorisationResponse> result);  }### Answer:
@Test void invokeCreatePiisAuthorisationAspect() { AspspSettings aspspSettings = new JsonReader().getObjectFromFile("json/aspect/aspsp-settings.json", AspspSettings.class); when(aspspProfileServiceWrapper.isForceXs2aBaseLinksUrl()) .thenReturn(aspspSettings.getCommon().isForceXs2aBaseLinksUrl()); when(aspspProfileServiceWrapper.getXs2aBaseLinksUrl()) .thenReturn(aspspSettings.getCommon().getXs2aBaseLinksUrl()); ResponseObject<AuthorisationResponse> authorisationResponseResponseObject = ResponseObject.<AuthorisationResponse>builder().body(createConsentAuthorizationResponse).build(); ResponseObject<AuthorisationResponse> authorisationResponseResponseObjectWithLinks = service.invokeCreatePiisAuthorisationAspect(authorisationResponseResponseObject); verify(createConsentAuthorizationResponse, times(1)).setLinks(any(CreatePiisAuthorisationLinks.class)); assertFalse(authorisationResponseResponseObjectWithLinks.hasError()); }