Merged 5.2.0 (5.2.0) to HEAD (5.2)

133845 rmunteanu: REPO-1746: Merge fixes for 5.2 GA issues to 5.2.0 branch
      Merged 5.2.N (5.2.1) to 5.2.0 (5.2.0)
         133290 jvonka: REPO-1646: V1 REST API - cannot unset optional fields (eg. when updating person / site details ...)
         - part 1 (Update Site)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@134184 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2017-01-11 10:34:24 +00:00
parent e58900ad81
commit 2b1c7382d1
5 changed files with 97 additions and 34 deletions

View File

@@ -30,7 +30,6 @@ import static org.junit.Assert.fail;
import java.util.*;
import org.alfresco.repo.model.filefolder.HiddenAspect;
import org.alfresco.repo.tenant.TenantUtil;
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
import org.alfresco.rest.api.model.SiteUpdate;
@@ -45,10 +44,10 @@ import org.alfresco.rest.api.tests.client.RequestContext;
import org.alfresco.rest.api.tests.client.data.*;
import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.util.GUID;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.httpclient.HttpStatus;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -541,9 +540,9 @@ public class TestSites extends EnterpriseTestApi
}
// +ve test: remove the description.
// This is a workaround for being unable to eplicitly null the field (see REPO-1409)
// This is a workaround for being unable to explicitly null the field (see REPO-1409)
{
Site site = sitesProxy.createSite(new SiteImpl("NoDescriptionTest", SiteVisibility.PUBLIC.toString()), 201);
Site site = sitesProxy.createSite(new SiteImpl(null, "NoDescriptionTest", "Initial description", SiteVisibility.PUBLIC.toString()), 201);
Site updatedSite = sitesProxy.updateSite(
site.getSiteId(),
@@ -566,10 +565,16 @@ public class TestSites extends EnterpriseTestApi
// Check the return from updateSite(...)
expectedUpdate.expected(updatedSite);
// TODO improve expected (and/or AssertUtil) and affected test cases
Assert.assertNull(updatedSite.getDescription());
// Double check a fresh retrieval matches.
Site fresh = sitesProxy.getSite(site.getSiteId(), 200);
expectedUpdate.expected(fresh);
// TODO improve expected (and/or AssertUtil) and affected test cases
Assert.assertNull(fresh.getDescription());
removeSiteQuietly(site.getSiteId());
}