mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126443 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 121939 jvonka: Nodes (FileFolder) API - update listChildren 'where' filtering (inc tests) for nodeType + subTypes RA-811, RA-634 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126789 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1427,20 +1427,31 @@ public class NodeApiTest extends AbstractBaseApiTest
|
||||
n1.expected(nodeResp);
|
||||
|
||||
|
||||
// filtering, via where clause (nodeType)
|
||||
// filtering, via where clause (nodeType + subTypes)
|
||||
|
||||
List<String> linkIds = Arrays.asList(n1Id, n2Id);
|
||||
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("where", "(nodeType='cm:link')");
|
||||
|
||||
Paging paging = getPaging(0, Integer.MAX_VALUE);
|
||||
|
||||
List<String> linkIds = Arrays.asList(n1Id, n2Id);
|
||||
|
||||
response = getAll(myChildrenUrl, user1, paging, params, 200);
|
||||
List<Node> nodes = jacksonUtil.parseEntries(response.getJsonResponse(), Node.class);
|
||||
assertEquals(0, nodes.size());
|
||||
|
||||
params = new HashMap<>();
|
||||
params.put("where", "(nodeType='cm:link' and subTypes=true)");
|
||||
|
||||
paging = getPaging(0, Integer.MAX_VALUE);
|
||||
|
||||
response = getAll(myChildrenUrl, user1, paging, params, 200);
|
||||
nodes = jacksonUtil.parseEntries(response.getJsonResponse(), Node.class);
|
||||
assertEquals(2, nodes.size());
|
||||
assertTrue(linkIds.contains(nodes.get(0).getId()));
|
||||
assertTrue(linkIds.contains(nodes.get(1).getId()));
|
||||
|
||||
|
||||
// delete file
|
||||
delete("nodes", user1, n1Id, 204);
|
||||
|
||||
@@ -1465,6 +1476,11 @@ public class NodeApiTest extends AbstractBaseApiTest
|
||||
|
||||
// -ve test - create - duplicate name
|
||||
post(myChildrenUrl, user1, toJsonAsStringNonNull(n2), 409);
|
||||
|
||||
// -ve test - unknown nodeType when filtering
|
||||
params = new HashMap<>();
|
||||
params.put("where", "(nodeType='my:unknown'");
|
||||
getAll(myChildrenUrl, user1, paging, params, 400);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user