mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126555 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 124248 gjames: RA-877: Copy api, return 422 instead of 500 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126901 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -146,6 +146,7 @@
|
||||
<entry key="org.alfresco.rest.framework.core.exceptions.DisabledServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_IMPLEMENTED}" />
|
||||
<entry key="org.alfresco.rest.framework.core.exceptions.InsufficientStorageException" value="507" />
|
||||
<entry key="org.alfresco.repo.node.integrity.IntegrityException" value="422" />
|
||||
<entry key="org.alfresco.repo.site.SiteServiceException" value="422" />
|
||||
<entry key="org.alfresco.rest.framework.core.exceptions.UnsupportedMediaTypeException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_UNSUPPORTED_MEDIA_TYPE}" />
|
||||
</map>
|
||||
</property>
|
||||
|
@@ -1503,6 +1503,32 @@ public class NodeApiTest extends AbstractBaseApiTest
|
||||
tgt.setTargetParentId(rootNodeId);
|
||||
post("nodes/"+d1Id+"/copy", user1, toJsonAsStringNonNull(tgt), null, 403);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCopySite() throws Exception
|
||||
{
|
||||
TestNetwork networkOne = getTestFixture().getRandomNetwork();
|
||||
TestPerson cs1 = networkOne.createUser();
|
||||
TestSite tSite = createSite(networkOne, cs1, SiteVisibility.PRIVATE);
|
||||
|
||||
// create folder
|
||||
Folder folderResp = createFolder(cs1.getId(), Nodes.PATH_MY, "siteCopytarget");
|
||||
String targetId = folderResp.getId();
|
||||
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("targetParentId", targetId);
|
||||
|
||||
//test that you can't copy a site
|
||||
post("nodes/"+tSite.getSiteInfo().getNodeRef().getId()+"/copy", cs1.getId(), toJsonAsStringNonNull(body), null, 422);
|
||||
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(cs1.getId());
|
||||
NodeRef docLibNodeRef = tSite.getContainerNodeRef("documentLibrary");
|
||||
|
||||
//test that you can't copy a site doclib
|
||||
post("nodes/"+docLibNodeRef.getId()+"/copy", cs1.getId(), toJsonAsStringNonNull(body), null, 422);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests create folder.
|
||||
* <p>POST:</p>
|
||||
|
@@ -48,6 +48,7 @@
|
||||
<entry key="org.alfresco.rest.framework.core.exceptions.DisabledServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_IMPLEMENTED}" />
|
||||
<entry key="org.alfresco.rest.framework.core.exceptions.InsufficientStorageException" value="507" />
|
||||
<entry key="org.alfresco.repo.node.integrity.IntegrityException" value="422" />
|
||||
<entry key="org.alfresco.repo.site.SiteServiceException" value="422" />
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
Reference in New Issue
Block a user