@SuppressWarnings({
"unchecked", "rawtypes"
})
public void doReadClientAccessToken(String response) throws Exception {
OAuthJSONProvider provider = new OAuthJSONProvider();
ClientAccessToken token = (ClientAccessToken)provider.readFrom((Class)ClientAccessToken.class,
ClientAccessToken.class,
new Annotation[]{},
MediaType.APPLICATION_JSON_TYPE,
new MetadataMap<String, String>(),
new ByteArrayInputStream(response.getBytes()));
assertEquals("1234", token.getTokenKey());
assertEquals("bearer", token.getTokenType());
assertEquals("5678", token.getRefreshToken());
assertEquals(12345, token.getExpiresIn());
assertEquals("read", token.getApprovedScope());
Map<String, String> extraParams = token.getParameters();
assertEquals(1, extraParams.size());
assertEquals("abc", extraParams.get("my_parameter"));
}