String json = JSONUtils.buildJSON(params);
JSONObject obj = new JSONObject(json);
AbstractXMLStreamReader reader = new MappedXMLStreamReader(obj);
Assert.assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
Assert.assertEquals(OAuthError.OAUTH_ERROR, reader.getName().getLocalPart());
Assert.assertEquals(OAuthError.TokenResponse.INVALID_REQUEST, reader.getText());
Assert.assertEquals(XMLStreamReader.CHARACTERS, reader.next());
Assert.assertEquals(XMLStreamReader.END_ELEMENT, reader.next());
Assert.assertEquals(XMLStreamReader.END_DOCUMENT, reader.next());
}