mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
committed by
GitHub
parent
84824edffa
commit
2af2e7b868
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Remote API
|
* 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.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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());
|
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)
|
private String getDeletedNodeRenditionsUrl(String nodeId)
|
||||||
{
|
{
|
||||||
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS;
|
return URL_DELETED_NODES + "/" + nodeId + "/" + URL_RENDITIONS;
|
||||||
|
@@ -68,7 +68,6 @@ import org.junit.After;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
import org.springframework.util.ResourceUtils;
|
import org.springframework.util.ResourceUtils;
|
||||||
import org.alfresco.service.cmr.repository.DirectAccessUrl;
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -97,6 +96,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
|||||||
private static final String RESOURCE_PREFIX = "publicapi/upload/";
|
private static final String RESOURCE_PREFIX = "publicapi/upload/";
|
||||||
|
|
||||||
protected static final String URL_NODES = "nodes";
|
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_RENDITIONS = "renditions";
|
||||||
protected static final String URL_VERSIONS = "versions";
|
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;
|
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
|
* The api scope. either public or private
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user