### Question:
AuthorisationServiceInternal implements AuthorisationService { @Transactional(readOnly = true) @Override public CmsResponse<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId) { Optional<AuthorisationScaApproachResponse> approachResponseOptional = authorisationRepository.findByExternalId(authorisationId) .map(a -> new AuthorisationScaApproachResponse(a.getScaApproach())); if (approachResponseOptional.isPresent()) { return CmsResponse.<AuthorisationScaApproachResponse>builder() .payload(approachResponseOptional.get()) .build(); } log.info("Authorisation ID: [{}]. Get SCA approach has failed, because authorisation couldn't be found", authorisationId); return CmsResponse.<AuthorisationScaApproachResponse>builder() .error(LOGICAL_ERROR) .build(); }  @Transactional @Override CmsResponse<CreateAuthorisationResponse> createAuthorisation(AuthorisationParentHolder parentHolder, CreateAuthorisationRequest request); @Transactional(readOnly = true) @Override CmsResponse<Authorisation> getAuthorisationById(String authorisationId); @Transactional @Override CmsResponse<Authorisation> updateAuthorisation(String authorisationId, UpdateAuthorisationRequest request); @Transactional @Override CmsResponse<Boolean> updateAuthorisationStatus(String authorisationId, ScaStatus scaStatus); @Transactional @Override CmsResponse<List<String>> getAuthorisationsByParentId(AuthorisationParentHolder parentHolder); @Transactional @Override CmsResponse<ScaStatus> getAuthorisationScaStatus(String authorisationId, AuthorisationParentHolder parentHolder); @Transactional(readOnly = true) @Override CmsResponse<Boolean> isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId); @Transactional @Override CmsResponse<Boolean> saveAuthenticationMethods(String authorisationId, List<CmsScaMethod> methods); @Transactional @Override CmsResponse<Boolean> updateScaApproach(String authorisationId, ScaApproach scaApproach); @Transactional(readOnly = true) @Override CmsResponse<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId);  }### Answer:
@Test void getAuthorisationScaApproach() { AuthorisationEntity authorisationEntity = new AuthorisationEntity(); authorisationEntity.setScaApproach(SCA_APPROACH); when(authorisationRepository.findByExternalId(AUTHORISATION_ID)) .thenReturn(Optional.of(authorisationEntity)); CmsResponse<AuthorisationScaApproachResponse> actualResponse = authorisationServiceInternal.getAuthorisationScaApproach(AUTHORISATION_ID); assertTrue(actualResponse.isSuccessful()); AuthorisationScaApproachResponse expectedResponse = new AuthorisationScaApproachResponse(SCA_APPROACH); assertEquals(expectedResponse, actualResponse.getPayload()); }
@Test void getAuthorisationScaApproach_wrongId() { when(authorisationRepository.findByExternalId(AUTHORISATION_ID)) .thenReturn(Optional.empty()); CmsResponse<AuthorisationScaApproachResponse> actualResponse = authorisationServiceInternal.getAuthorisationScaApproach(AUTHORISATION_ID); assertFalse(actualResponse.isSuccessful()); assertEquals(CmsError.LOGICAL_ERROR, actualResponse.getError()); }