Feature/acs 1834 test dau for deleted nodes (#686)

* Deleted Nodes DAU Test

* Deleted Nodes DAU Test Moved

* DAU Test Modification

* Copyright

* Unused import
This commit is contained in:
mikolajbrzezinski
2021-08-31 08:07:42 -04:00
committed by GitHub
parent 84824edffa
commit 2af2e7b868
2 changed files with 35 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -704,6 +704,34 @@ public class DeletedNodesTest extends AbstractSingleNetworkSiteTest
assertNull("We don't show the parent id for a deleted node",aNode.getParentId());
}
@Test
public void testRequestArchivedContentDirectUrl() throws Exception
{
setRequestContext(user1);
String myNodeId = getMyNodeId();
String fileName = "TestDocumentToArchive.txt";
Document testDocumentToArchive = new Document();
testDocumentToArchive.setName(fileName);
testDocumentToArchive.setNodeType(TYPE_CM_CONTENT);
// create *empty* text file
HttpResponse response = post(getNodeChildrenUrl(myNodeId), toJsonAsStringNonNull(testDocumentToArchive), 201);
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
final String contentNodeId = document.getId();
deleteNode(contentNodeId);
// Check the upload response
assertEquals(fileName, document.getName());
ContentInfo contentInfo = document.getContent();
assertNotNull(contentInfo);
assertEquals(MimetypeMap.MIMETYPE_TEXT_PLAIN, contentInfo.getMimeType());
HttpResponse dauResponse = post(getRequestArchivedContentDirectUrl(contentNodeId), null, null, null, null, 501);
}
private String getDeletedNodeRenditionsUrl(String nodeId)
{
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS;

View File

@@ -68,7 +68,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.experimental.categories.Category;
import org.springframework.util.ResourceUtils;
import org.alfresco.service.cmr.repository.DirectAccessUrl;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -97,6 +96,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
private static final String RESOURCE_PREFIX = "publicapi/upload/";
protected static final String URL_NODES = "nodes";
protected static final String URL_DELETED_NODES = "deleted-nodes";
protected static final String URL_RENDITIONS = "renditions";
protected static final String URL_VERSIONS = "versions";
@@ -219,6 +219,11 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
return URL_NODES + "/" + nodeId + "/" + REQUEST_DIRECT_ACCESS_URL;
}
protected String getRequestArchivedContentDirectUrl(String nodeId)
{
return URL_DELETED_NODES + "/" + nodeId + "/" + REQUEST_DIRECT_ACCESS_URL;
}
/**
* The api scope. either public or private
*