diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/search/CmisQueryTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/search/CmisQueryTests.java
new file mode 100644
index 0000000000..8be8ff293d
--- /dev/null
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/search/CmisQueryTests.java
@@ -0,0 +1,233 @@
+/*
+ * #%L
+ * Alfresco Records Management Module
+ * %%
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ * %%
+ * This file is part of the Alfresco software.
+ * -
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ * -
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * -
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * -
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see
+ * - a collaboration site with documents + * - in place records + * - category with folder and records + * - a user with no rm rights (no rights to see the record from file plan) + * - a user with rights to see the records and the other documents created + *+ */ + @BeforeClass (alwaysRun = true) + public void setupCmisQuery() throws Exception + { + STEP("Create a collaboration site"); + collaborationSite = dataSite.usingAdmin().createPrivateRandomSite(); + + STEP("Create 10 documents ending with SEARCH_TERM"); + for (int i = 0; ++i <= 10; ) + { + FileModel fileModel = new FileModel(String.format("%s.%s", "Doc" + i + SEARCH_TERM, + FileType.TEXT_PLAIN.extention)); + dataContent.usingAdmin().usingSite(collaborationSite).createContent(fileModel); + } + + STEP("Create a collaborator user for the collaboration site"); + nonRMUser = getDataUser().createRandomTestUser(); + getDataUser().addUserToSite(nonRMUser, collaborationSite, UserRole.SiteManager); + + STEP("Create 10 documents and declare as records"); + for (int i = 0; ++i <= 10; ) + { + FileModel fileModel = new FileModel(String.format("%s.%s", "InPlace " + SEARCH_TERM + i, + FileType.TEXT_PLAIN.extention)); + fileModel = dataContent.usingUser(nonRMUser).usingSite(collaborationSite).createContent(fileModel); + getRestAPIFactory().getFilesAPI(nonRMUser).declareAsRecord(fileModel.getNodeRefWithoutVersion()); + } + + STEP("Create record folder and some records "); + recordFolder = createCategoryFolderInFilePlan(); + for (int i = 0; ++i <= 10; ) + { + createElectronicRecord(recordFolder.getId(), "Record " + SEARCH_TERM + i); + } + STEP("Create an rm user with read permission over the category created and contributor role within the " + + "collaboration site"); + rmUser = getDataUser().createRandomTestUser(); + getRestAPIFactory().getRMUserAPI().assignRoleToUser(rmUser.getUsername(), ROLE_RM_MANAGER); + getRestAPIFactory().getRMUserAPI().addUserPermission(recordFolder.getParentId(), rmUser, UserPermissions.PERMISSION_READ_RECORDS); + getDataUser().addUserToSite(rmUser, collaborationSite, UserRole.SiteContributor); + + + //do a cmis query to wait for solr indexing + long currentTime = System.currentTimeMillis(); + long endTime = 0; + do + { + try + { + endTime = System.currentTimeMillis(); + ItemIterable
+ * Given the RM site created + * When I execute a cmis query to get all the documents names + * Then I get all documents names 100 per page + *+ */ + @Test + @AlfrescoTest (jira = "MNT-19442") + public void getAllDocumentsNamesCmisQuery() + { + // execute the cmis query + String cq = "SELECT cmis:name FROM cmis:document"; + ItemIterable
+ * Given the RM site created + * When I execute a cmis query to get all the documents names with a particular name + * Then I get all documents names user has permission + *+ */ + @Test + @AlfrescoTest (jira = "MNT-19442") + public void getDocumentsWithSpecificNamesCmisQuery() throws Exception + { + // execute the cmis query + ItemIterable
+ * Given the RM site created + * When I execute a cmis query to get all the documents names with a specific number per page + * Then I get all documents names paged as requested that the user has permission + *+ */ + @Test + @AlfrescoTest (jira = "MNT-19442") + public void getDocumentsCmisQueryWithPagination() throws Exception + { + OperationContext oc = new OperationContextImpl(); + oc.setMaxItemsPerPage(10); + ItemIterable