[MNT-24127] Added Endpoint to Calculate Size of the folder with Integration Test Cases [ags][tas]

This commit is contained in:
mohit-singh4
2024-07-02 14:40:13 +05:30
parent 98a9d6467c
commit 1f1d80d93d
3 changed files with 6 additions and 4 deletions

View File

@@ -256,7 +256,10 @@ public class NodeFolderSizeRelation implements CalculateSize<Map<String, Object>
if(folderSizeAction!=null)
{
String errorInAction = (String) folderSizeAction.getParameterValue(NodeSizeActionExecuter.ERROR);
throw new InvalidNodeTypeException(errorInAction);
if(errorInAction.length()>1)
{
throw new InvalidNodeTypeException(errorInAction);
}
}
}

View File

@@ -33,7 +33,5 @@ public class FolderSizeModel
{
/** Folder Model URI */
private static final String SIZE_MODEL_1_0_URI = "http://www.alfresco.org/model/size/1.0";
public static final QName PROP_STATUS = QName.createQName(SIZE_MODEL_1_0_URI, "status");
public static final QName PROP_OUTPUT = QName.createQName(SIZE_MODEL_1_0_URI, "result");
public static final QName PROP_ERROR = QName.createQName(SIZE_MODEL_1_0_URI, "error");
}

View File

@@ -104,7 +104,8 @@ public class NodeSizeActionExecuterTest extends BaseSpringTest
ActionImpl action = new ActionImpl(null, ID, NodeSizeActionExecuter.NAME, null);
action.setParameterValue(NodeSizeActionExecuter.PAGE_SIZE, maxItems);
this.executer.executeImpl(action, this.nodeRef);
Map<String, Object> mapResult = (Map<String, Object>)this.nodeService.getProperty(this.nodeRef, FolderSizeModel.PROP_OUTPUT);
Object resultAction = action.getParameterValue(NodeSizeActionExecuter.RESULT);
Map<String, Object> mapResult = (Map<String, Object>)resultAction;
assertTrue(mapResult != null);
}
}