/**
   * Converts the soap model instance into a normal model instance.
   *
   * @param soapModel the soap model instance to convert
   * @return the normal model instance
   */
  public static SocialActivitySetting toModel(SocialActivitySettingSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    SocialActivitySetting model = new SocialActivitySettingImpl();

    model.setActivitySettingId(soapModel.getActivitySettingId());
    model.setGroupId(soapModel.getGroupId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setClassNameId(soapModel.getClassNameId());
    model.setActivityType(soapModel.getActivityType());
    model.setName(soapModel.getName());
    model.setValue(soapModel.getValue());

    return model;
  }
  protected SocialActivitySetting addSocialActivitySetting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    SocialActivitySetting socialActivitySetting = _persistence.create(pk);

    socialActivitySetting.setGroupId(RandomTestUtil.nextLong());

    socialActivitySetting.setCompanyId(RandomTestUtil.nextLong());

    socialActivitySetting.setClassNameId(RandomTestUtil.nextLong());

    socialActivitySetting.setActivityType(RandomTestUtil.nextInt());

    socialActivitySetting.setName(RandomTestUtil.randomString());

    socialActivitySetting.setValue(RandomTestUtil.randomString());

    _persistence.update(socialActivitySetting);

    return socialActivitySetting;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    SocialActivitySetting newSocialActivitySetting = _persistence.create(pk);

    newSocialActivitySetting.setGroupId(RandomTestUtil.nextLong());

    newSocialActivitySetting.setCompanyId(RandomTestUtil.nextLong());

    newSocialActivitySetting.setClassNameId(RandomTestUtil.nextLong());

    newSocialActivitySetting.setActivityType(RandomTestUtil.nextInt());

    newSocialActivitySetting.setName(RandomTestUtil.randomString());

    newSocialActivitySetting.setValue(RandomTestUtil.randomString());

    _persistence.update(newSocialActivitySetting);

    SocialActivitySetting existingSocialActivitySetting =
        _persistence.findByPrimaryKey(newSocialActivitySetting.getPrimaryKey());

    Assert.assertEquals(
        existingSocialActivitySetting.getActivitySettingId(),
        newSocialActivitySetting.getActivitySettingId());
    Assert.assertEquals(
        existingSocialActivitySetting.getGroupId(), newSocialActivitySetting.getGroupId());
    Assert.assertEquals(
        existingSocialActivitySetting.getCompanyId(), newSocialActivitySetting.getCompanyId());
    Assert.assertEquals(
        existingSocialActivitySetting.getClassNameId(), newSocialActivitySetting.getClassNameId());
    Assert.assertEquals(
        existingSocialActivitySetting.getActivityType(),
        newSocialActivitySetting.getActivityType());
    Assert.assertEquals(
        existingSocialActivitySetting.getName(), newSocialActivitySetting.getName());
    Assert.assertEquals(
        existingSocialActivitySetting.getValue(), newSocialActivitySetting.getValue());
  }