Package org.apache.shindig.social.opensocial.spi

Examples of org.apache.shindig.social.opensocial.spi.UserId


    private void testDeletePersonData(String ownerId, String viewerId, Set<String> fieldsToDelete,
                                      HashMap<String, String> expectedApplicationDataAfterDelete,
                                      ApplicationData applicationData) {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(ownerId, viewerId, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
View Full Code Here


        assertEquals(expectedApplicationData.getData(), actualApplicationData.getData());
    }

    private void testDeletePersonDataNoAppDataExpected(ApplicationData applicationData) throws InterruptedException, ExecutionException {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
View Full Code Here

    private void testUpdatePersonData(Set<String> fields, Map<String, String> values,
                                      HashMap<String, String> expectedApplicationDataAfterUpdate,
                                      ApplicationData applicationData) {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
View Full Code Here

        service = new DefaultPersonService(repository);
    }

    @Test
    public void getPerson_allFields() throws ExecutionException, InterruptedException {
        UserId id = new UserId(UserId.Type.userId, ID_1);
        Set<String> fields = new HashSet<String>();

        org.apache.rave.opensocial.model.Person dbPerson = getDbPerson();
        expect(repository.get(Long.parseLong(ID_1))).andReturn(dbPerson);
        replay(repository);
View Full Code Here

        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }

    @Test
    public void getPerson_restrictedFields() throws ExecutionException, InterruptedException {
        UserId id = new UserId(UserId.Type.userId, ID_1);
        Set<String> fields = new HashSet<String>();
        fields.add(Person.Field.DISPLAY_NAME.toString());
        fields.add(Person.Field.ID.toString());

        org.apache.rave.opensocial.model.Person dbPerson = getDbPerson();
View Full Code Here

        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }

    @Test
    public void getPerson_nullFields() throws ExecutionException, InterruptedException {
        UserId id = new UserId(UserId.Type.userId, ID_1);

        org.apache.rave.opensocial.model.Person dbPerson = getDbPerson();
        expect(repository.get(Long.parseLong(ID_1))).andReturn(dbPerson);
        replay(repository);
View Full Code Here

        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }

    @Test
    public void getPerson_viewer() throws ExecutionException, InterruptedException {
        UserId id = new UserId(UserId.Type.viewer, ID_2);

        expect(token.getViewerId()).andReturn(ID_1);
        replay(token);

        org.apache.rave.opensocial.model.Person dbPerson = getDbPerson();
View Full Code Here

        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }

    @Test(expected = ProtocolException.class)
    public void getPerson_nullValue() throws ExecutionException, InterruptedException {
        UserId id = new UserId(UserId.Type.userId, ID_2);

        expect(repository.get(Long.parseLong(ID_1))).andReturn(null);
        replay(repository);

        service.getPerson(id, null, token);
View Full Code Here

        return Lists.asList(getDbPerson(), new org.apache.rave.opensocial.model.Person[]{});
    }

    private Set<UserId> getUserIdSet() {
        Set<UserId> ids = new HashSet<UserId>();
        ids.add(new UserId(UserId.Type.userId, ID_2));
        ids.add(new UserId(UserId.Type.userId, ID_3));
        return ids;
    }
View Full Code Here

            case friends:
                return getUniqueListOfFriends(userIds, collectionOptions, token);
            case objectId:
                return getGroupMembersFromRepository(collectionOptions, groupId.getObjectId().toString(), token.getAppId());
            case self:
                return Lists.newArrayList(getPersonForId(new UserId(UserId.Type.me, null), token));
            case custom:
                throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Custom GroupIDs are not tracked by the container");
            default:
                throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Invalid group id specified by request");
        }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.spi.UserId

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.