Package org.pac4j.oauth.profile.linkedin2

Examples of org.pac4j.oauth.profile.linkedin2.LinkedIn2Converters


        final LinkedIn2Date startDate = position.getStartDate();
        assertEquals(2012, startDate.getYear().intValue());
        assertEquals(3, startDate.getMonth().intValue());
        assertTrue(position.getIsCurrent().booleanValue());
        assertNull(position.getEndDate());
        final LinkedIn2Company company = position.getCompany();
        assertEquals("PAC4J", company.getName());
        assertNull(company.getIndustry());
        assertEquals("http://www.linkedin.com/profile/view?id=167439971&authType=name&authToken=_IWF&trk=api*a167383*s175634*",
                     profile.getSiteStandardProfileRequest());
        assertEquals("167439971", profile.getOAuth10Id());
        assertEquals(14, profile.getAttributes().size());
    }
View Full Code Here


        assertEquals(2, positions.size());
        final LinkedIn2Position position = positions.get(0);
        assertEquals("417494299", position.getId());
        assertEquals("Developer", position.getTitle());
        assertEquals("Desc", position.getSummary());
        final LinkedIn2Date startDate = position.getStartDate();
        assertEquals(2012, startDate.getYear().intValue());
        assertEquals(3, startDate.getMonth().intValue());
        assertTrue(position.getIsCurrent().booleanValue());
        assertNull(position.getEndDate());
        final LinkedIn2Company company = position.getCompany();
        assertEquals("PAC4J", company.getName());
        assertNull(company.getIndustry());
View Full Code Here

                            null,
                            Gender.UNSPECIFIED,
                            null,
                            "http://m.c.lnkd.licdn.com/mpr/mprx/0_XGm9Ldp1WfMsB74Zk32WLwptW7DZvoWZQisWLwSfnuJeEmY4eXYVwIJ3bFSb9DeNL3uHo21cF5lC",
                            "http://www.linkedin.com/pub/test-scribeup/48/aa/16b", "Paris Area, France");
        final LinkedIn2Location location = profile.getCompleteLocation();
        assertEquals("Paris Area, France", location.getName());
        assertEquals("fr", location.getCode());
        assertNull(profile.getMaidenName());
        assertEquals("ScribeUP développeur chez OpenSource", profile.getHeadline());
        assertEquals("Information Technology and Services", profile.getIndustry());
        assertEquals(1, profile.getNumConnections().intValue());
        assertEquals("This is a summary...", profile.getSummary());
View Full Code Here

        assertEquals(1, profile.getNumConnections().intValue());
        assertEquals("This is a summary...", profile.getSummary());
        assertNull(profile.getSpecialties());
        final List<LinkedIn2Position> positions = profile.getPositions();
        assertEquals(2, positions.size());
        final LinkedIn2Position position = positions.get(0);
        assertEquals("417494299", position.getId());
        assertEquals("Developer", position.getTitle());
        assertEquals("Desc", position.getSummary());
        final LinkedIn2Date startDate = position.getStartDate();
        assertEquals(2012, startDate.getYear().intValue());
        assertEquals(3, startDate.getMonth().intValue());
        assertTrue(position.getIsCurrent().booleanValue());
        assertNull(position.getEndDate());
        final LinkedIn2Company company = position.getCompany();
        assertEquals("PAC4J", company.getName());
        assertNull(company.getIndustry());
        assertEquals("http://www.linkedin.com/profile/view?id=167439971&amp;authType=name&amp;authToken=_IWF&amp;trk=api*a167383*s175634*",
                     profile.getSiteStandardProfileRequest());
        assertEquals("167439971", profile.getOAuth10Id());
View Full Code Here

        return "https://api.linkedin.com/v1/people/~:(" + this.fields + ")";
    }
   
    @Override
    protected LinkedIn2Profile extractUserProfile(final String body) {
        LinkedIn2Profile profile = new LinkedIn2Profile();
        profile.setId(XmlHelper.get(body, "id"));
        for (final String attribute : OAuthAttributesDefinitions.linkedin2Definition.getPrincipalAttributes()) {
            profile.addAttribute(attribute, XmlHelper.get(body, attribute));
        }
        String url = XmlHelper.get(XmlHelper.get(body, LinkedIn2AttributesDefinition.SITE_STANDARD_PROFILE_REQUEST),
                                   "url");
        profile.addAttribute(LinkedIn2AttributesDefinition.SITE_STANDARD_PROFILE_REQUEST, url);
        return profile;
    }
View Full Code Here

        kryo.register(LinkedIn2Company.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final LinkedIn2Profile profile = (LinkedIn2Profile) userProfile;
        logger.debug("profile : {}", profile);
        assertEquals("JJjS_5BOzW", profile.getId());
        assertEquals(LinkedIn2Profile.class.getSimpleName() + UserProfile.SEPARATOR + "JJjS_5BOzW",
                     profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), LinkedIn2Profile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile,
                            "testscribeup@gmail.com",
                            "test",
                            "scribeUp",
                            "test scribeUp",
                            null,
                            Gender.UNSPECIFIED,
                            null,
                            "http://m.c.lnkd.licdn.com/mpr/mprx/0_XGm9Ldp1WfMsB74Zk32WLwptW7DZvoWZQisWLwSfnuJeEmY4eXYVwIJ3bFSb9DeNL3uHo21cF5lC",
                            "http://www.linkedin.com/pub/test-scribeup/48/aa/16b", "Paris Area, France");
        final LinkedIn2Location location = profile.getCompleteLocation();
        assertEquals("Paris Area, France", location.getName());
        assertEquals("fr", location.getCode());
        assertNull(profile.getMaidenName());
        assertEquals("ScribeUP développeur chez OpenSource", profile.getHeadline());
        assertEquals("Information Technology and Services", profile.getIndustry());
        assertEquals(1, profile.getNumConnections().intValue());
        assertEquals("This is a summary...", profile.getSummary());
        assertNull(profile.getSpecialties());
        final List<LinkedIn2Position> positions = profile.getPositions();
        assertEquals(2, positions.size());
        final LinkedIn2Position position = positions.get(0);
        assertEquals("417494299", position.getId());
        assertEquals("Developer", position.getTitle());
        assertEquals("Desc", position.getSummary());
        final LinkedIn2Date startDate = position.getStartDate();
        assertEquals(2012, startDate.getYear().intValue());
        assertEquals(3, startDate.getMonth().intValue());
        assertTrue(position.getIsCurrent().booleanValue());
        assertNull(position.getEndDate());
        final LinkedIn2Company company = position.getCompany();
        assertEquals("PAC4J", company.getName());
        assertNull(company.getIndustry());
        assertEquals("http://www.linkedin.com/profile/view?id=167439971&amp;authType=name&amp;authToken=_IWF&amp;trk=api*a167383*s175634*",
                     profile.getSiteStandardProfileRequest());
        assertEquals("167439971", profile.getOAuth10Id());
        assertEquals(14, profile.getAttributes().size());
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.linkedin2.LinkedIn2Converters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.