MockHttpServletRequest request = new MockHttpServletRequest("POST", "/oauth/register");
request.setContentType(OAuth.ContentType.JSON);
request.setContent(validJson.getBytes("UTF-8"));
final JSONHttpServletRequestWrapper jsonWrapper = new JSONHttpServletRequestWrapper(request);
OAuthServerRegistrationRequest registrationRequest = new OAuthServerRegistrationRequest(jsonWrapper);
Assert.assertEquals("Uploading and also editing capabilities!",
registrationRequest.getClientDescription());
Assert.assertEquals("http://onlinephotogallery.com/icon.png", registrationRequest.getClientIcon());
Assert.assertEquals("Online Photo Gallery", registrationRequest.getClientName());
Assert
.assertEquals("https://onlinephotogallery.com/client_reg", registrationRequest.getRedirectURI());
Assert.assertEquals("push", registrationRequest.getType());
Assert.assertEquals("http://onlinephotogallery.com", registrationRequest.getClientUrl());
}