[feature/MNT-24127-EndpointToCalculateFolderSize] Added Endpoint to calculate folder size

This commit is contained in:
Mohit Singh
2024-07-31 11:47:52 +05:30
parent 0ce174586d
commit 044b05481f

View File

@@ -28,6 +28,7 @@ package org.alfresco.rest.api.tests;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.rest.api.model.NodeTarget; import org.alfresco.rest.api.model.NodeTarget;
import org.alfresco.rest.api.model.Site; import org.alfresco.rest.api.model.Site;
import org.alfresco.rest.api.nodes.NodesEntityResource;
import org.alfresco.rest.api.tests.client.HttpResponse; import org.alfresco.rest.api.tests.client.HttpResponse;
import org.alfresco.rest.api.tests.client.PublicApiHttpClient; import org.alfresco.rest.api.tests.client.PublicApiHttpClient;
import org.alfresco.rest.api.tests.util.RestApiUtil; import org.alfresco.rest.api.tests.util.RestApiUtil;
@@ -152,14 +153,8 @@ public class NodeFolderSizeApiTest extends AbstractBaseApiTest
{ {
AuthenticationUtil.setFullyAuthenticatedUser(user1); AuthenticationUtil.setFullyAuthenticatedUser(user1);
Map<String, String> params = new HashMap<>();
params.put("nodeId", folderId);
params.put("skipCount", "0");
params.put("maxItems", "100");
params.put("properties", "");
// Check if response and JSON parsing were successful // Check if response and JSON parsing were successful
HttpResponse response = get(getFolderSizeDataUrl(folderId),params,200); HttpResponse response = getSingle(NodesEntityResource.class, folderId+"/get-folder-size", null, 200);
String jsonResponse = String.valueOf(response.getJsonResponse()); String jsonResponse = String.valueOf(response.getJsonResponse());
assertNotNull("JSON response should not be null", jsonResponse); assertNotNull("JSON response should not be null", jsonResponse);