Search in sources :

Example 1 with LinkedInProvider

use of org.olat.login.oauth.spi.LinkedInProvider in project OpenOLAT by OpenOLAT.

the class OAuthDispatcherTest method parseEmail_linkedIn.

@Test
public void parseEmail_linkedIn() {
    StringBuilder sb = new StringBuilder();
    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>").append("<person>").append("<first-name>John</first-name>").append("<last-name>Smith</last-name>").append("<email-address>j.smith@openolat.com</email-address>").append("</person>");
    OAuthUser infos = new LinkedInProvider().parseInfos(sb.toString());
    Assert.assertNotNull(infos);
    Assert.assertEquals("John", infos.getFirstName());
    Assert.assertEquals("Smith", infos.getLastName());
    Assert.assertEquals("j.smith@openolat.com", infos.getEmail());
}
Also used : OAuthUser(org.olat.login.oauth.model.OAuthUser) LinkedInProvider(org.olat.login.oauth.spi.LinkedInProvider) Test(org.junit.Test)

Example 2 with LinkedInProvider

use of org.olat.login.oauth.spi.LinkedInProvider in project openolat by klemens.

the class OAuthDispatcherTest method parseEmail_linkedIn.

@Test
public void parseEmail_linkedIn() {
    StringBuilder sb = new StringBuilder();
    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>").append("<person>").append("<first-name>John</first-name>").append("<last-name>Smith</last-name>").append("<email-address>j.smith@openolat.com</email-address>").append("</person>");
    OAuthUser infos = new LinkedInProvider().parseInfos(sb.toString());
    Assert.assertNotNull(infos);
    Assert.assertEquals("John", infos.getFirstName());
    Assert.assertEquals("Smith", infos.getLastName());
    Assert.assertEquals("j.smith@openolat.com", infos.getEmail());
}
Also used : OAuthUser(org.olat.login.oauth.model.OAuthUser) LinkedInProvider(org.olat.login.oauth.spi.LinkedInProvider) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 OAuthUser (org.olat.login.oauth.model.OAuthUser)2 LinkedInProvider (org.olat.login.oauth.spi.LinkedInProvider)2