### Question:
SantanderOauth2Service implements Oauth2Service, PkceOauth2Extension { @Override public URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) throws IOException { requireValid(validateGetAuthorizationRequestUri(headers, parameters)); return UriBuilder.fromUri(oauth2Service.getAuthorizationRequestUri(headers, parameters)) .queryParam("scope", scope(parameters)) .build(); } SantanderOauth2Service(Oauth2Service oauth2Service); static SantanderOauth2Service create(Aspsp aspsp, HttpClient httpClient, Pkcs12KeyStore keyStore); @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);  }### Answer:
@Test void getAuthorizationRequestUriForPayment() throws Exception { Parameters parameters = new Parameters(); parameters.setScaOAuthLink(SCA_OAUTH_LINK); parameters.setRedirectUri(REDIRECT_URI); parameters.setState(STATE); parameters.setPaymentId(PAYMENT_ID); URI authorizationRequestUri = oauth2Service.getAuthorizationRequestUri(null, parameters); assertThat(authorizationRequestUri) .hasToString("https: "response_type=code" + "&state=" + STATE + "&redirect_uri=" + URLEncoder.encode(REDIRECT_URI, StandardCharsets.UTF_8.name()) + "&code_challenge_method=S256" + "&code_challenge=" + oauth2Service.codeChallenge() + "&client_id=" + CLIENT_ID + "&scope=PIS%3A" + PAYMENT_ID); }
@Test void getAuthorizationRequestUriForConsent() throws Exception { Parameters parameters = new Parameters(); parameters.setScaOAuthLink(SCA_OAUTH_LINK); parameters.setRedirectUri(REDIRECT_URI); parameters.setState(STATE); parameters.setConsentId(CONSENT_ID); URI authorizationRequestUri = oauth2Service.getAuthorizationRequestUri(null, parameters); assertThat(authorizationRequestUri) .hasToString("https: "response_type=code" + "&state=" + STATE + "&redirect_uri=" + URLEncoder.encode(REDIRECT_URI, StandardCharsets.UTF_8.name()) + "&code_challenge_method=S256" + "&code_challenge=" + oauth2Service.codeChallenge() + "&client_id=" + CLIENT_ID + "&scope=AIS%3A" + CONSENT_ID); }