### Question:
SpardaOauth2Service implements Oauth2Service, PkceOauth2Extension { @Override public List<ValidationError> validateGetAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) { List<ValidationError> validationErrors = new ArrayList<>(); if (StringUtils.isBlank(parameters.getRedirectUri())) { validationErrors.add(ValidationError.required(Parameters.REDIRECT_URI)); } String scope = parameters.getScope(); if (StringUtils.isBlank(scope)) { validationErrors.add(ValidationError.required(Parameters.SCOPE)); } else if (!Scope.contains(scope)) { validationErrors.add(new ValidationError(ValidationError.Code.NOT_SUPPORTED, Parameters.SCOPE, String.format(UNSUPPORTED_SCOPE_VALUE_ERROR_MESSAGE, scope))); } return validationErrors; } private  SpardaOauth2Service(Aspsp aspsp,
                                Oauth2Service oauth2Service,
                                String clientId); static SpardaOauth2Service create(Aspsp aspsp,
                                             HttpClient httpClient,
                                             Pkcs12KeyStore keyStore,
                                             String clientId); @Override URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters); @Override List<ValidationError> validateGetAuthorizationRequestUri(Map<String, String> headers, Parameters parameters); @Override TokenResponse getToken(Map<String, String> headers, Parameters parameters); @Override List<ValidationError> validateGetToken(Map<String, String> headers, Parameters parameters); @Override byte[] octetSequence();  }### Answer:
@Test void validateGetAuthorizationRequestUri() { List<ValidationError> validationErrors = oauth2Service.validateGetAuthorizationRequestUri(null, new Parameters()); assertThat(validationErrors) .extracting(ValidationError::getPath) .contains(Parameters.REDIRECT_URI, Parameters.SCOPE); }
@Test void validateGetAuthorizationRequestUriWithUnsupportedScope() { Parameters parameters = new Parameters(); parameters.setRedirectUri(REDIRECT_URI); parameters.setScope(UNSUPPORTED_SCOPE); List<ValidationError> validationErrors = oauth2Service.validateGetAuthorizationRequestUri(null, parameters); assertThat(validationErrors).hasSize(1); ValidationError validationError = validationErrors.get(0); assertThat(validationError).isNotNull(); assertThat(validationError.getCode()).isEqualTo(ValidationError.Code.NOT_SUPPORTED); assertThat(validationError.getPath()).isEqualTo(Parameters.SCOPE); assertThat(validationError.getMessage()) .isEqualTo(String.format(UNSUPPORTED_SCOPE_VALUE_ERROR_MESSAGE, UNSUPPORTED_SCOPE)); }