### Question:
Xs2aAuthorisationService { public Optional<ScaStatus> getAuthorisationScaStatus(String authorisationId, String parentId, AuthorisationType authorisationType) { CmsResponse<ScaStatus> response = authorisationServiceEncrypted.getAuthorisationScaStatus(authorisationId, new AuthorisationParentHolder(authorisationType, parentId)); if (response.hasError()) { return Optional.empty(); } return Optional.ofNullable(response.getPayload()); }  Optional<CreateAuthorisationResponse> createAuthorisation(CreateAuthorisationRequest request, String parentId, AuthorisationType authorisationType); Optional<Authorisation> getAuthorisationById(String authorisationId); void updateScaApproach(String authorisationId, ScaApproach scaApproach); boolean saveAuthenticationMethods(String authorisationId, List<AuthenticationObject> methods); boolean isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId); void updateAuthorisationStatus(String authorisationId, ScaStatus scaStatus); Optional<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId); Optional<List<String>> getAuthorisationSubResources(String parentId, AuthorisationType authorisationType); CmsResponse<Authorisation> updateAuthorisation(UpdateAuthorisationRequest request, String authorisationId); Optional<ScaStatus> getAuthorisationScaStatus(String authorisationId, String parentId, AuthorisationType authorisationType);  }### Answer:
@Test void getAuthorisationScaStatus() { when(authorisationServiceEncrypted.getAuthorisationScaStatus(AUTHORISATION_ID, new AisAuthorisationParentHolder(CONSENT_ID))) .thenReturn(CmsResponse.<ScaStatus>builder().payload(ScaStatus.PSUIDENTIFIED).build()); Optional<ScaStatus> actual = authorisationService.getAuthorisationScaStatus(AUTHORISATION_ID, CONSENT_ID, AuthorisationType.CONSENT); assertTrue(actual.isPresent()); assertEquals(ScaStatus.PSUIDENTIFIED, actual.get()); }
@Test void getAuthorisationScaStatus_hasError() { when(authorisationServiceEncrypted.getAuthorisationScaStatus(AUTHORISATION_ID, new AisAuthorisationParentHolder(CONSENT_ID))) .thenReturn(CmsResponse.<ScaStatus>builder().error(CmsError.TECHNICAL_ERROR).build()); Optional<ScaStatus> actual = authorisationService.getAuthorisationScaStatus(AUTHORISATION_ID, CONSENT_ID, AuthorisationType.CONSENT); assertTrue(actual.isEmpty()); }