mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Feature/acs 1835 test dau for deleted renditions (#689)
* Deleted Renditions DAU Test Skeleton * Deleted Renditions DAU Test v1 * Deleted Renditions DAU Test v2 * Deleted Renditions DAU Test v3 * Deleted Renditions DAU Test v3.1 * Comments From Pull Request
This commit is contained in:
committed by
GitHub
parent
59b641474f
commit
d2bb3a980d
@@ -78,8 +78,6 @@ public class DeletedNodesTest extends AbstractSingleNetworkSiteTest
|
||||
|
||||
protected static final String URL_DELETED_NODES = "deleted-nodes";
|
||||
private static final String URL_RENDITIONS = "renditions";
|
||||
|
||||
private final static long DELAY_IN_MS = 500;
|
||||
|
||||
@Override
|
||||
public void setup() throws Exception
|
||||
@@ -732,6 +730,45 @@ public class DeletedNodesTest extends AbstractSingleNetworkSiteTest
|
||||
HttpResponse dauResponse = post(getRequestArchivedContentDirectUrl(contentNodeId), null, null, null, null, 501);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestArchivedRenditionDirectUrl() throws Exception
|
||||
{
|
||||
setRequestContext(user1);
|
||||
|
||||
// Create a folder within the site document's library
|
||||
Date now = new Date();
|
||||
String folder1 = "folder" + now.getTime() + "_1";
|
||||
Folder createdFolder = createFolder(tDocLibNodeId, folder1, null);
|
||||
assertNotNull(createdFolder);
|
||||
String f1Id = createdFolder.getId();
|
||||
|
||||
// Create multipart request using an existing file
|
||||
String fileName = "quick.pdf";
|
||||
File file = getResourceFile(fileName);
|
||||
MultiPartBuilder multiPartBuilder = MultiPartBuilder.create().setFileData(new MultiPartBuilder.FileData(fileName, file));
|
||||
MultiPartBuilder.MultiPartRequest reqBody = multiPartBuilder.build();
|
||||
|
||||
// Upload quick.pdf file into 'folder'
|
||||
HttpResponse response = post(getNodeChildrenUrl(f1Id), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
String contentNodeId = document.getId();
|
||||
|
||||
Rendition rendition = createAndGetRendition(contentNodeId, "doclib");
|
||||
assertNotNull(rendition);
|
||||
String renditionID = rendition.getId();
|
||||
assertEquals(Rendition.RenditionStatus.CREATED, rendition.getStatus());
|
||||
|
||||
deleteNode(contentNodeId);
|
||||
|
||||
HttpResponse dauResponse = post(getRequestArchivedRenditonContentDirectUrl(contentNodeId, renditionID), null, null, null, null, 501);
|
||||
}
|
||||
|
||||
private String addToDocumentLibrary(String name, String nodeType, String userId) throws Exception
|
||||
{
|
||||
String parentId = getSiteContainerNodeId(Nodes.PATH_MY, "documentLibrary");
|
||||
return createNode(parentId, name, nodeType, null).getId();
|
||||
}
|
||||
|
||||
private String getDeletedNodeRenditionsUrl(String nodeId)
|
||||
{
|
||||
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS;
|
||||
|
@@ -224,6 +224,11 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
return URL_DELETED_NODES + "/" + nodeId + "/" + REQUEST_DIRECT_ACCESS_URL;
|
||||
}
|
||||
|
||||
protected String getRequestArchivedRenditonContentDirectUrl(String nodeId, String renditionID)
|
||||
{
|
||||
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS + "/" + renditionID + "/" + REQUEST_DIRECT_ACCESS_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* The api scope. either public or private
|
||||
*
|
||||
|
Reference in New Issue
Block a user