use of org.olat.login.oauth.spi.TwitterProvider in project OpenOLAT by OpenOLAT.
the class OAuthDispatcherTest method parseUserInfos_twitter.
@Test
public void parseUserInfos_twitter() throws IOException {
URL jsonUrl = OAuthDispatcherTest.class.getResource("verify_credentials.json");
String body = IOUtils.toString(jsonUrl, "UTF-8");
OAuthUser infos = new TwitterProvider().parseInfos(body);
Assert.assertNotNull(infos);
Assert.assertEquals("38895958", infos.getId());
Assert.assertEquals("Sean", infos.getFirstName());
Assert.assertEquals("Cook", infos.getLastName());
Assert.assertEquals("en", infos.getLang());
}
use of org.olat.login.oauth.spi.TwitterProvider in project openolat by klemens.
the class OAuthDispatcherTest method parseUserInfos_twitter.
@Test
public void parseUserInfos_twitter() throws IOException {
URL jsonUrl = OAuthDispatcherTest.class.getResource("verify_credentials.json");
String body = IOUtils.toString(jsonUrl, "UTF-8");
OAuthUser infos = new TwitterProvider().parseInfos(body);
Assert.assertNotNull(infos);
Assert.assertEquals("38895958", infos.getId());
Assert.assertEquals("Sean", infos.getFirstName());
Assert.assertEquals("Cook", infos.getLastName());
Assert.assertEquals("en", infos.getLang());
}
Aggregations