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)
126521 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 123021 jvonka: (Quick) Shared Links API - as requested, add extra +ve/-ve tests for optional "attachment" header when getting file/rendition content (via unauthenticated shared link) - note: also tested via the NodeApiTest (when getting file/rendition content) RA-829, RA-830 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126865 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.parsePaging;
|
||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsString;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -55,7 +54,6 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -311,7 +309,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
n.setProperties(props);
|
||||
|
||||
// create node
|
||||
HttpResponse response = post("nodes/" + parentId + "/children", runAsUserId, RestApiUtil.toJsonAsStringNonNull(n), 201);
|
||||
HttpResponse response = post(getNodeChildrenUrl(parentId), runAsUserId, RestApiUtil.toJsonAsStringNonNull(n), 201);
|
||||
|
||||
return RestApiUtil.parseRestApiEntry(response.getJsonResponse(), returnType);
|
||||
}
|
||||
@@ -331,7 +329,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
.setProperties(props)
|
||||
.build();
|
||||
|
||||
HttpResponse response = post("nodes/" + parentId + "/children", userId, reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
HttpResponse response = post(getNodeChildrenUrl(parentId), userId, reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
return RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
}
|
||||
|
||||
@@ -358,7 +356,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponse res = post(getRenditionsUrl(sourceNodeId), userId, toJsonAsString(renditionRequest), 202);
|
||||
HttpResponse res = post(getNodeRenditionsUrl(sourceNodeId), userId, toJsonAsString(renditionRequest), 202);
|
||||
assertNull(res.getJsonResponse());
|
||||
break;
|
||||
}
|
||||
@@ -376,7 +374,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponse response = getSingle(getRenditionsUrl(sourceNodeId), userId, renditionId, 200);
|
||||
HttpResponse response = getSingle(getNodeRenditionsUrl(sourceNodeId), userId, renditionId, 200);
|
||||
Rendition rendition = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Rendition.class);
|
||||
assertNotNull(rendition);
|
||||
assertEquals(Rendition.RenditionStatus.CREATED, rendition.getStatus());
|
||||
@@ -394,9 +392,13 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getRenditionsUrl(String nodeId)
|
||||
protected String getNodeRenditionsUrl(String nodeId)
|
||||
{
|
||||
return "nodes/" + nodeId + "/renditions";
|
||||
}
|
||||
|
||||
protected String getNodeChildrenUrl(String nodeId)
|
||||
{
|
||||
return "nodes/" + nodeId + "/children";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user