public void testFullConstructor()
throws Exception {
URI url = new URI("https://c2id.com/userinfo");
BearerAccessToken token = new BearerAccessToken();
UserInfoRequest request = new UserInfoRequest(url, HTTPRequest.Method.POST, token);
assertEquals(url, request.getEndpointURI());
assertEquals(token, request.getAccessToken());
assertEquals(HTTPRequest.Method.POST, request.getMethod());
HTTPRequest httpRequest = request.toHTTPRequest();
assertEquals(HTTPRequest.Method.POST, httpRequest.getMethod());
assertEquals(url, httpRequest.getURL().toURI());
assertEquals("application/x-www-form-urlencoded; charset=UTF-8", httpRequest.getContentType().toString());
assertEquals("access_token="+token.getValue(), httpRequest.getQuery());
assertNull(httpRequest.getAuthorization());
request = UserInfoRequest.parse(httpRequest);
assertEquals(url, request.getEndpointURI());