### Question:
SparkasseOauth2Service extends Oauth2ServiceDecorator implements PkceOauth2Extension { @Override public URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) throws IOException { requireValid(validateGetAuthorizationRequestUri(headers, parameters)); return UriBuilder.fromUri(oauth2Service.getAuthorizationRequestUri(headers, parameters)) .renameQueryParam(Parameters.RESPONSE_TYPE, "responseType") .renameQueryParam(Parameters.CLIENT_ID, "clientId") .build(); } private  SparkasseOauth2Service(Oauth2Service oauth2Service); static SparkasseOauth2Service create(Aspsp aspsp, HttpClient httpClient, Pkcs12KeyStore keyStore); @Override URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters); @Override TokenResponse getToken(Map<String, String> headers, Parameters parameters);  }### Answer:
@Test void getAuthorizationRequestUri() throws IOException { Parameters parameters = new Parameters(); parameters.setScaOAuthLink(SCA_OAUTH_LINK); parameters.setState(STATE); parameters.setConsentId(CONSENT_ID); URI uri = oauth2Service.getAuthorizationRequestUri(null, parameters); assertEquals(AUTHORIZATION_ENDPOINT + "?" + "responseType=code&" + "state=xyz&" + "clientId=" + ORG_ID + "&" + "code_challenge_method=S256&" + "code_challenge=" + oauth2Service.codeChallenge() + "&" + "scope=AIS%3A+" + CONSENT_ID, uri.toString()); }
@Test void getAuthorizationRequestUriForPayment() throws IOException { Parameters parameters = new Parameters(); parameters.setScaOAuthLink(SCA_OAUTH_LINK); parameters.setState(STATE); parameters.setPaymentId("payment-id"); URI uri = oauth2Service.getAuthorizationRequestUri(null, parameters); assertEquals(AUTHORIZATION_ENDPOINT + "?" + "responseType=code&" + "state=xyz&" + "clientId=" + ORG_ID + "&" + "code_challenge_method=S256&" + "code_challenge=" + oauth2Service.codeChallenge() + "&" + "scope=PIS%3A+payment-id", uri.toString()); }