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

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


    people.put(people.length(),jsonPerson);

    SecurityToken updateToken = new FakeGadgetToken("appId", "appUrl", "domain", "viewer", "trustedJson", "viewer", "20");

    // Get user
    UserId userId = new UserId(UserId.Type.userId, "updatePerson");
    Person person = db
        .getPerson(userId, Person.Field.ALL_FIELDS, token).get();

    // update a field in user object
    person.setThumbnailUrl("http://newthumbnail.url");
View Full Code Here


    Person person = new PersonImpl();
    List<Person> people = Lists.newArrayList(person);
    RestfulCollection<Person> data = new RestfulCollection<Person>(people);
    // TODO: We aren't passing john.doe to the service yet.
    expect(personService.getPeople(
        eq(ImmutableSet.of(new UserId(UserId.Type.userId, "jane.doe"))),
        eq(new GroupId(GroupId.Type.self, null)), eq(DEFAULT_OPTIONS),
        eq(DEFAULT_FIELDS), eq(token)))
        .andReturn(ImmediateFuture.newInstance(data));

    replay();
View Full Code Here

    RestHandler operation = registry.getRestHandler(path, "GET");

    List<Person> people = ImmutableList.of();
    RestfulCollection<Person> data = new RestfulCollection<Person>(people);
    Set<UserId> userIdSet = Sets.newLinkedHashSet(JOHN_DOE);
    userIdSet.add(new UserId(UserId.Type.userId, "jane.doe"));
    expect(personService.getPeople(eq(userIdSet),
        eq(new GroupId(GroupId.Type.self, null)),
        eq(DEFAULT_OPTIONS),
        eq(DEFAULT_FIELDS),
        eq(token))).andReturn(ImmediateFuture.newInstance(data));
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.findByUsername(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.findByUsername(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.findByUsername(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

        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.findByUsername(ID_1)).andReturn(dbPerson);
        replay(repository);
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.