### Question:
RedirectPisScaAuthorisationService implements PisScaAuthorisationService { @Override public Optional<Xs2aAuthorisationSubResources> getAuthorisationSubResources(String paymentId) { return authorisationService.getAuthorisationSubResources(paymentId) .map(Xs2aAuthorisationSubResources::new); }  @Override Optional<Xs2aCreatePisAuthorisationResponse> createCommonPaymentAuthorisation(String paymentId, PaymentType paymentType, PsuIdData psuData); @Override Xs2aUpdatePisCommonPaymentPsuDataResponse updateCommonPaymentPsuData(Xs2aUpdatePisCommonPaymentPsuDataRequest request); @Override void updateAuthorisation(UpdateAuthorisationRequest request, AuthorisationProcessorResponse response); @Override void updateCancellationAuthorisation(UpdateAuthorisationRequest request, AuthorisationProcessorResponse response); @Override Optional<Xs2aCreatePisCancellationAuthorisationResponse> createCommonPaymentCancellationAuthorisation(String paymentId, PaymentType paymentType, PsuIdData psuData); @Override Optional<Xs2aPaymentCancellationAuthorisationSubResource> getCancellationAuthorisationSubResources(String paymentId); @Override Xs2aUpdatePisCommonPaymentPsuDataResponse updateCommonPaymentCancellationPsuData(Xs2aUpdatePisCommonPaymentPsuDataRequest request); @Override Optional<Xs2aAuthorisationSubResources> getAuthorisationSubResources(String paymentId); @Override Optional<ScaStatus> getAuthorisationScaStatus(String paymentId, String authorisationId); @Override Optional<ScaStatus> getCancellationAuthorisationScaStatus(String paymentId, String authorisationId); @Override ScaApproach getScaApproachServiceType();  }### Answer:
@Test void getAuthorisationSubResources_success() { when(pisAuthorisationService.getAuthorisationSubResources(PAYMENT_ID)) .thenReturn(Optional.of(STRING_LIST)); Optional<Xs2aAuthorisationSubResources> actualResponse = redirectPisScaAuthorisationService.getAuthorisationSubResources(PAYMENT_ID); assertTrue(actualResponse.isPresent()); assertThat(actualResponse).isEqualTo(Optional.of(XS2A_AUTHORISATION_SUB_RESOURCES)); }
@Test void getAuthorisationSubResources_wrongPaymentId_fail() { when(pisAuthorisationService.getAuthorisationSubResources(WRONG_PAYMENT_ID)) .thenReturn(Optional.empty()); Optional<Xs2aAuthorisationSubResources> actualResponse = redirectPisScaAuthorisationService.getAuthorisationSubResources(WRONG_PAYMENT_ID); assertThat(actualResponse.isPresent()).isFalse(); }