Examples of RestIdentity


Examples of org.exoplatform.social.client.api.model.RestIdentity

  public void shouldCreate() throws SocialClientLibException {
    if (!canRunTest()) {
      return;
    }
    startSessionAs("root", "gtn");
    RestIdentity restIdentity = identityService.getIdentity("organization", "root");
    RestActivity activity = new RestActivity();
    activity.setTitle("Hello World");
    RestActivity resultActivity = activityService.create(activity);

    assertThat("resultActivity's title should be: \"Hello World\"", "Hello World", equalTo(resultActivity.getTitle()));

    assertThat("resultActivity's identityId should be:  restIdentity.getId()", restIdentity.getId(), equalTo(resultActivity.getIdentityId()));
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  @Test(expectedExceptions = UnsupportedMethodException.class)
  public void testCreate() throws SocialClientLibException {
    if (!canRunTest()) {
      throw new UnsupportedMethodException();
    }
    identityService.create(new RestIdentity());
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  public void testGetIdentity() throws SocialClientLibException {
    if (!canRunTest()) {
      return;
    }
    String id = getRootIdentity().getId();
    RestIdentity identity = identityService.get(id);
    assertThat("Identity must not be null", identity, notNullValue());
    assertThat("Identity provider must be organization", identity.getProviderId(), equalTo("organization"));
    assertThat("RemoteId must be demo", identity.getRemoteId(), equalTo("root"));

    RestProfile profile = identity.getProfile();
    assertThat("profile must not be null", profile, notNullValue());
    assertThat("profile.getAvatarUrl() must not be null", profile.getAvatarUrl(), notNullValue());
    assertThat("profile.getFullName() must return: Root Root", profile.getFullName(), equalTo("Root Root"));

    try {
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  @Test
  public void testGetIdentityByProviderAndRemoteId() throws Exception {
    if (!canRunTest()) {
      return;
    }
    RestIdentity restIdentity = identityService.getIdentity("organization", "root");
    assertThat("RestIdentity must not null.", restIdentity, notNullValue());
    assertThat("RemoteId must be root", "root", equalTo(restIdentity.getRemoteId()));
    assertThat("Provider must be organization", "organization", equalTo(restIdentity.getProviderId()));
    RestProfile restProfile = restIdentity.getProfile();
    assertThat("Avatar URL must not be null", restProfile.getAvatarUrl(), notNullValue());
    assertThat("Profile's full name must be root gtn", "Root Root", equalTo(restProfile.getFullName()));
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

public class IdentityImplTest {

  @Test
  public void shouldCreteInstanceAndGetFields() {
    RestProfile restProfile = new RestProfile();
    RestIdentity restIdentity = new RestIdentity("123", "organization", "demo", restProfile);
    assertThat("restIdentity.getId() must return 123", restIdentity.getId(), equalTo("123"));
    assertThat("restIdentity.getProviderId() must return organization",
               restIdentity.getProviderId(), equalTo("organization"));
    assertThat("restIdentity.getRemoteId() must return demo", restIdentity.getRemoteId(), equalTo("demo"));
    //gets default value
    assertThat("restIdentity.getProfile() must be null",
                restIdentity.getProfile(), equalTo((RestProfile)new RestProfile()));
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

    for(RestActivity e : activities) {
      assertThat("PosterIdentity must not be null.", e.getPosterIdentity(), notNullValue());
      assertThat("ActivityStream must not be null.", e.getActivityStream(), notNullValue());
      assertThat("LikedByIdentity must not be null.", e.getAvailableLikes(), notNullValue());

      RestIdentity identity = e.getAvailableLikes().get(0);
      assertThat("RestProfile must not be null.", identity.getProfile(), notNullValue());

      RestProfile profile = identity.getProfile();
      assertThat(profile.getFullName(), equalTo("Demo GTN"));
      assertThat(profile.getAvatarUrl(), equalTo("http://localhost:8080/profile/u/demo/avatar.jpg?u=12345"));
    }
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  public void shouldCreate() throws SocialClientLibException {
    if (!canRunTest()) {
      return;
    }
    startSessionAs("root", "gtn");
    RestIdentity restIdentity = identityService.getIdentity("organization", "root");
    RestActivity activity = new RestActivity();
    activity.setTitle("Hello World");
    RestActivity resultActivity = activityService.create(activity);

    assertThat("resultActivity's title should be: \"Hello World\"", "Hello World", equalTo(resultActivity.getTitle()));

    assertThat("resultActivity's identityId should be:  restIdentity.getId()", restIdentity.getId(), equalTo(resultActivity.getIdentityId()));
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  @Test(expectedExceptions = UnsupportedMethodException.class)
  public void testCreate() throws SocialClientLibException {
    if (!canRunTest()) {
      throw new UnsupportedMethodException();
    }
    identityService.create(new RestIdentity());
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  public void testGetIdentity() throws SocialClientLibException {
    if (!canRunTest()) {
      return;
    }
    String id = getDemoIdentityId();
    RestIdentity identity = identityService.get(id);
    assertThat("Identity must not be null", identity, notNullValue());
    assertThat("Identity provider must be organization", identity.getProviderId(), equalTo("organization"));
    assertThat("RemoteId must be demo", identity.getRemoteId(), equalTo("root"));
   
    RestProfile profile = identity.getProfile();
    assertThat("profile must not be null", profile, notNullValue());
    assertThat("profile.getAvatarUrl() must be null", profile.getAvatarUrl(), nullValue());
    assertThat("profile.getFullName() must return: Demo gtn", profile.getFullName(), equalTo("Demo gtn"));
   
    try {
View Full Code Here

Examples of org.exoplatform.social.client.api.model.RestIdentity

  @Test
  public void testGetIdentityByProviderAndRemoteId() throws Exception {
    if (!canRunTest()) {
      return;
    }
    RestIdentity restIdentity = identityService.getIdentity("organization", "root");
    assertThat("RestIdentity must not null.", restIdentity, notNullValue());
    assertThat("RemoteId must be root", "root", equalTo(restIdentity.getRemoteId()));
    assertThat("Provider must be organization", "organization", equalTo(restIdentity.getProviderId()));
    RestProfile restProfile = restIdentity.getProfile();
    assertThat("Avatar URL must be null", restProfile.getAvatarUrl(), nullValue());
    assertThat("Profile's full name must be root gtn", "Root Root", equalTo(restProfile.getFullName()));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.