use of org.olat.login.oauth.spi.Google2Provider in project OpenOLAT by OpenOLAT.
the class OAuthDispatcherTest method parseUserInfos_google.
@Test
public void parseUserInfos_google() throws IOException {
URL jsonUrl = OAuthDispatcherTest.class.getResource("me_google.json");
String body = IOUtils.toString(jsonUrl, "UTF-8");
OAuthUser infos = new Google2Provider().parseInfos(body);
Assert.assertNotNull(infos);
Assert.assertEquals("101991806793974537467", infos.getId());
Assert.assertEquals("John", infos.getFirstName());
Assert.assertEquals("Smith", infos.getLastName());
Assert.assertEquals("fr", infos.getLang());
}
use of org.olat.login.oauth.spi.Google2Provider in project openolat by klemens.
the class OAuthDispatcherTest method parseUserInfos_google.
@Test
public void parseUserInfos_google() throws IOException {
URL jsonUrl = OAuthDispatcherTest.class.getResource("me_google.json");
String body = IOUtils.toString(jsonUrl, "UTF-8");
OAuthUser infos = new Google2Provider().parseInfos(body);
Assert.assertNotNull(infos);
Assert.assertEquals("101991806793974537467", infos.getId());
Assert.assertEquals("John", infos.getFirstName());
Assert.assertEquals("Smith", infos.getLastName());
Assert.assertEquals("fr", infos.getLang());
}
Aggregations