### Question:
CommerzbankOauth2Service extends Oauth2ServiceDecorator implements PkceOauth2Extension { @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) throws IOException { parameters.removeScaOAuthLink(); parameters.setTokenEndpoint(StringUri.fromElements(baseUrl, "/v1/token")); return oauth2Service.getToken(headers, parameters); } private  CommerzbankOauth2Service(Oauth2Service oauth2Service, String baseUrl); static CommerzbankOauth2Service 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 getToken() throws IOException { Parameters parameters = new Parameters(); parameters.setGrantType(Oauth2Service.GrantType.AUTHORIZATION_CODE.toString()); parameters.setAuthorizationCode(AUTHORIZATION_CODE); parameters.setRedirectUri(REDIRECT_URI); oauth2Service.getToken(null, parameters); Map<String, String> expectedBody = new HashMap<>(); expectedBody.put(Parameters.GRANT_TYPE, Oauth2Service.GrantType.AUTHORIZATION_CODE.toString()); expectedBody.put(Parameters.CODE, AUTHORIZATION_CODE); expectedBody.put(Parameters.CLIENT_ID, ORG_ID); expectedBody.put(Parameters.REDIRECT_URI, REDIRECT_URI); expectedBody.put(Parameters.CODE_VERIFIER, oauth2Service.codeVerifier()); Mockito.verify(httpClient, Mockito.times(1)).send(ArgumentMatchers.argThat(req -> { boolean tokenExchange = req.uri().equals(TOKEN_ENDPOINT); if (tokenExchange) { assertEquals(expectedBody, req.urlEncodedBody()); } return tokenExchange; }), Mockito.any()); }