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

This commit is contained in:
Mohit Singh
2024-08-01 17:16:57 +05:30
parent 7a16e30f30
commit 58cd9db730
2 changed files with 6 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
private static final String URL_CHILDREN = "children";
private static final String URL_CONTENT = "content";
private static final String URL_CALCULATEFOLDERSIZE = "calculate-folder-size";
private static final String URL_GETFOLDERSIZE = "get-folder-size";
protected static final String TYPE_CM_FOLDER = "cm:folder";
protected static final String TYPE_CM_CONTENT = "cm:content";
@@ -1126,5 +1127,9 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
{
return URL_NODES + "/" + nodeId + "/" + URL_CALCULATEFOLDERSIZE;
}
protected String getFolderSizeDataUrl(String nodeId)
{
return URL_NODES + "/" + nodeId + "/" + URL_GETFOLDERSIZE;
}
}

View File

@@ -140,7 +140,7 @@ public class NodeFolderSizeApiTest extends AbstractBaseApiTest
AuthenticationUtil.setFullyAuthenticatedUser(user1);
// Check if response and JSON parsing were successful
HttpResponse response = getSingle(NodesEntityResource.class, folderId+"/get-folder-size", null, 200);
HttpResponse response = putBinary(getFolderSizeDataUrl(folderId), null, null, null, 200);
String jsonResponse = String.valueOf(response.getJsonResponse());
assertNotNull("JSON response should not be null", jsonResponse);