Package org.apache.shindig.social.opensocial.model

Examples of org.apache.shindig.social.opensocial.model.Person


        assertThat(activities.contains(ACTIVITY_2), is(true));
    }

    @Test
    public void getActivities_notset() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.AGE, Person.Field.BOOKS));
        assertThat(p.getActivities(), is(nullValue()));
    }
View Full Code Here


        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.AGE, Person.Field.BOOKS));
        assertThat(p.getActivities(), is(nullValue()));
    }
    @Test
    public void getBooks_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.BOOKS, Person.Field.ACTIVITIES));
        assertThat(p.getBooks().isEmpty(), is(true));
    }
View Full Code Here

        assertThat(p.getBooks().isEmpty(), is(true));
    }

    @Test
    public void getCars_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.CARS, Person.Field.ACTIVITIES));
        assertThat(p.getCars().isEmpty(), is(true));
    }
View Full Code Here

        assertThat(p.getCars().isEmpty(), is(true));
    }

    @Test
    public void getBodyType_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.BODY_TYPE));
        assertThat(p.getBodyType().getBuild(), is(equalTo(BODY_BUILD)));
        assertThat(p.getBodyType().getEyeColor(), is(equalTo(BODY_EYE_COLOR)));
    }
View Full Code Here

        assertThat(p.getBodyType().getEyeColor(), is(equalTo(BODY_EYE_COLOR)));
    }

    @Test
    public void getBodyType_notset() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.AGE, Person.Field.ACTIVITIES));
        assertThat(p.getBodyType(), is(nullValue()));
    }
View Full Code Here

        assertThat(p.getBodyType(), is(nullValue()));
    }

    @Test
    public void getChildren_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.ABOUT_ME));
        assertThat(p.getChildren(), is(nullValue()));
    }
View Full Code Here

        assertThat(p.getChildren(), is(nullValue()));
    }

    @Test
    public void getDrinker_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.DRINKER));
        assertThat(p.getDrinker().getValue(), is(equalTo(Drinker.HEAVILY)));
    }
View Full Code Here

        assertThat(p.getDrinker().getValue(), is(equalTo(Drinker.HEAVILY)));
    }

    @Test
    public void getDrinker_notset() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.ABOUT_ME));
        assertThat(p.getDrinker(), is(nullValue()));
    }
View Full Code Here

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

        Future<Person> personFuture = service.getPerson(id, fields, token);
        assertThat(personFuture, is(not(nullValue())));
        Person person = personFuture.get();
        assertThat(person, is(not(nullValue())));
        assertThat(person, is(instanceOf(FieldRestrictingPerson.class)));
        assertThat(person.getId(), is(equalTo(ID_1)));
        assertThat(person.getHappiestWhen(), is(equalTo(HAPPIEST_WHEN)));
        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }
View Full Code Here

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

        Future<Person> personFuture = service.getPerson(id, fields, token);
        assertThat(personFuture, is(not(nullValue())));
        Person person = personFuture.get();
        assertThat(person, is(not(nullValue())));
        assertThat(person, is(instanceOf(FieldRestrictingPerson.class)));
        assertThat(person.getId(), is(equalTo(ID_1)));
        assertThat(person.getHappiestWhen(), is(nullValue()));
        assertThat(person.getDisplayName(), is(equalTo(DISPLAY_NAME)));
    }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.model.Person

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.