diff --git a/pom.xml b/pom.xml index e2a7cf24a9..e91a141ffe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-rm pom - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT Alfresco Records Management diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 9104de22fb..1033c353a4 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 65d2d48dcd..36080c3d8e 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm-automation - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index 05d4add82e..25fe4d9954 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -77,6 +77,7 @@ import org.alfresco.rest.search.RestRequestQueryModel; import org.alfresco.rest.search.SearchNodeModel; import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.v0.RMRolesAndActionsAPI; +import org.alfresco.rest.v0.SearchAPI; import org.alfresco.utility.data.DataUser; import org.alfresco.utility.model.ContentModel; import org.alfresco.utility.model.FolderModel; @@ -113,7 +114,11 @@ public class BaseRMRestTest extends RestTest @Autowired @Getter(value = PROTECTED) private RMRolesAndActionsAPI rmRolesAndActionsAPI; - + + @Autowired + @Getter(value = PROTECTED) + private SearchAPI searchApi; + /** * Asserts the given status code * @@ -505,7 +510,7 @@ public class BaseRMRestTest extends RestTest { return getFilePlanAsUser(getAdminUser(), componentId); } - + /** * Recursively delete a folder * @@ -663,6 +668,46 @@ public class BaseRMRestTest extends RestTest return names; } + /** + * Returns records search results for the given search term + * + * @param user + * @param term + * @return + * @throws Exception + */ + public List searchForRMContentAsUser(UserModel user, String term, String expectedResult) throws Exception + { + List results = new ArrayList<>(); + // wait for solr indexing + int counter = 0; + int waitInMilliSeconds = 6000; + while (counter < 3) + { + results = searchApi.searchForRecordsAsUser(user.getUsername(), user.getPassword(), term); + if ((results != null && !results.isEmpty() && results.contains(expectedResult))) + { + break; + } else + { + counter++; + } + // double wait time to not overdo solr search + waitInMilliSeconds = (waitInMilliSeconds * 2); + synchronized (this) + { + try + { + this.wait(waitInMilliSeconds); + } catch (InterruptedException e) + { + } + } + + } + return results; + } + /** * Helper method to return site document library content model * diff --git a/rm-community/pom.xml b/rm-community/pom.xml index d6952c6f7c..9e3e1d0779 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index c391029aad..0f2cb1c749 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-rm-community - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 6f91aebef2..cded13c0aa 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-rm-community - 2.7-SNAPSHOT + 3.0.0-SNAPSHOT