public void testWithAccessTokenAndClientAuth()
throws Exception {
URI endpointURI = new URI("https://c2id.com/token/revoke");
Token token = new BearerAccessToken();
ClientAuthentication clientAuth = new ClientSecretBasic(new ClientID("123"), new Secret("secret"));
TokenRevocationRequest request = new TokenRevocationRequest(endpointURI, clientAuth, token);
assertEquals(endpointURI, request.getEndpointURI());
assertEquals(clientAuth, request.getClientAuthentication());
assertEquals(token, request.getToken());
HTTPRequest httpRequest = request.toHTTPRequest();
assertEquals(HTTPRequest.Method.POST, httpRequest.getMethod());
assertEquals(endpointURI.toURL().toString(), httpRequest.getURL().toString());
assertEquals(CommonContentTypes.APPLICATION_URLENCODED, httpRequest.getContentType());
assertEquals(token.getValue(), httpRequest.getQueryParameters().get("token"));
assertEquals("access_token", httpRequest.getQueryParameters().get("token_type_hint"));
assertEquals(2, httpRequest.getQueryParameters().size());
ClientSecretBasic basicAuth = ClientSecretBasic.parse(httpRequest.getAuthorization());
assertEquals("123", basicAuth.getClientID().getValue());
assertEquals("secret", basicAuth.getClientSecret().getValue());
}