### Question:
SpardaOauth2Service implements Oauth2Service, PkceOauth2Extension { @Override public List<ValidationError> validateGetToken(Map<String, String> headers, Parameters parameters) { if (parameters.getAuthorizationCode() != null && StringUtils.isBlank(parameters.getRedirectUri())) { return Collections.singletonList(ValidationError.required(Parameters.REDIRECT_URI)); } return Collections.emptyList(); } 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 validateGetToken() { List<ValidationError> validationErrors = oauth2Service.validateGetToken(null, new Parameters()); assertThat(validationErrors).isEmpty(); }
@Test void redirectUriIsRequiredForAuthorizationCodeExchange() { Parameters parameters = new Parameters(); parameters.setAuthorizationCode("asdf"); List<ValidationError> validationErrors = oauth2Service.validateGetToken(null, parameters); assertThat(validationErrors) .extracting(ValidationError::getPath) .containsExactly(Parameters.REDIRECT_URI); }