From 07ad6dc1d77f28da110528d758316b61cfe41af1 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Tue, 15 Nov 2016 16:33:48 +0000 Subject: [PATCH 01/15] RM-4023: Unfiled records folders tests --- .../alfresco/rest/rm/base/BaseRestTest.java | 14 + .../UnfiledRecordsFolderTests.java | 241 ++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java index 6129987124..2af7cfcf86 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java @@ -21,6 +21,7 @@ import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFie import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.rest.rm.model.site.RMSiteCompliance.STANDARD; import static org.alfresco.rest.rm.model.site.RMSiteFields.COMPLIANCE; import static org.alfresco.rest.rm.model.site.RMSiteFields.DESCRIPTION; @@ -163,6 +164,19 @@ public class BaseRestTest extends RestTest return createComponent(parentCategoryId, folderName, RECORD_FOLDER_TYPE, FOLDER_TITLE); } + /** + * Helper method to create child unfiled record folder + * + * @param parentId The id of the parent folder + * @param folderName The name of the folder + * @return The created folder + * @throws Exception on unsuccessful component creation + */ + public FilePlanComponent createUnfiledRecordsFolder(String parentId, String folderName) throws Exception + { + return createComponent(parentId, folderName, UNFILED_RECORD_FOLDER_TYPE, FOLDER_TITLE); + } + /** * Helper method to create generic child component * diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java new file mode 100644 index 0000000000..4c44b2e196 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -0,0 +1,241 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + * #L% + */ +package org.alfresco.rest.rm.fileplancomponents; + +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.*; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; +import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; +import static org.springframework.http.HttpStatus.CREATED; +import static org.springframework.http.HttpStatus.NOT_FOUND; +import static org.springframework.http.HttpStatus.NO_CONTENT; +import static org.springframework.http.HttpStatus.OK; +import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; + +import com.google.gson.JsonObject; + +import org.alfresco.rest.rm.base.BaseRestTest; +import org.alfresco.rest.core.RestWrapper; +import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentEntry; +import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; +import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; +import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; +import org.alfresco.rest.rm.requests.FilePlanComponentAPI; +import org.alfresco.utility.data.DataUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.testng.annotations.Test; + +/** + * Unfiled Records folder CRUD API tests + * + * @author Kristijan Conkas + * @since 1.0 + */ +public class UnfiledRecordsFolderTests extends BaseRestTest +{ + @Autowired + private FilePlanComponentAPI filePlanComponentAPI; + + @Autowired + private DataUser dataUser; + + /** invalid root level types, at root level these shouldn't be possible to create */ + private static final List INVALID_ROOT_TYPES = Arrays.asList( + FILE_PLAN_TYPE, + RECORD_CATEGORY_TYPE, + RECORD_FOLDER_TYPE, + HOLD_TYPE, + HOLD_CONTAINER_TYPE, + TRANSFER_CONTAINER_TYPE, + UNFILED_CONTAINER_TYPE); + + // Number of children (for children creation test) + private static final int NUMBER_OF_CHILDREN = 10; + + /** + * Given the unfiled record container root + * When I create an unfiled record folder via the ReST API + * Then a root unfiled record folder is created + *
+ * @throws Exception if folder couldn't be created + */ + @Test(description = "Create root unfiled records folder") + public void createRootUnfiledRecordsFolder() throws Exception + { + // Authenticate with admin user + RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + + String folderName = "Folder " + getRandomAlphanumeric(); + String folderTitle = folderName + " Title"; + String folderDescription = folderName + " Description"; + + // Build the record category properties + JsonObject unfiledFolderProperties = buildObject() + .add(NAME, folderName) + .add(NODE_TYPE, UNFILED_RECORD_FOLDER_TYPE.toString()) + .addObject(PROPERTIES) + .add(PROPERTIES_TITLE, folderTitle) + .add(PROPERTIES_DESCRIPTION, folderDescription) + .end() + .getJson(); + + FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + UNFILED_RECORDS_CONTAINER_ALIAS.toString()); + + // Verify the status code + restWrapper.assertStatusCodeIs(CREATED); + + // Verify the returned file plan component + assertFalse(filePlanComponent.isIsCategory()); + assertFalse(filePlanComponent.isIsFile()); + assertFalse(filePlanComponent.isIsRecordFolder()); // it is not a _normal_ record folder! + + assertEquals(filePlanComponent.getName(), folderName); + assertEquals(filePlanComponent.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString()); + assertFalse(filePlanComponent.isHasRetentionSchedule()); + + assertEquals(filePlanComponent.getCreatedByUser().getId(), dataUser.getAdminUser().getUsername()); + + // Verify the returned file plan component properties + FilePlanComponentProperties filePlanComponentProperties = filePlanComponent.getProperties(); + assertEquals(filePlanComponentProperties.getTitle(), folderTitle); + assertEquals(filePlanComponentProperties.getDescription(), folderDescription); + } + + /** + * Negative test to verify only unfiled record folders can be created at root level + */ + @Test(description = "Only unfiled records folders can be created at unfiled records root level") + public void onlyRecordFoldersCanBeCreatedAtUnfiledRecordsRoot() + { + RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + + String folderName = "Folder " + getRandomAlphanumeric(); + String folderTitle = folderName + " Title"; + String folderDescription = folderName + " Description"; + + INVALID_ROOT_TYPES.stream() + .peek(a -> logger.info("creating " + a.toString())) + .forEach(t -> { + JsonObject unfiledFolderProperties = buildObject() + .add(NAME, folderName) + .add(NODE_TYPE, t.toString()) + .addObject(PROPERTIES) + .add(PROPERTIES_TITLE, folderTitle) + .add(PROPERTIES_DESCRIPTION, folderDescription) + .end() + .getJson(); + try + { + filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + UNFILED_RECORDS_CONTAINER_ALIAS.toString()); + } + catch (Exception error) + { + } + + // Verify the status code + restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY); + }); + } + + /** + * Given an unfiled record folder + * When I create an unfiled record folder via the ReST API + * Then an unfiled record folder is created within the unfiled record folder + * + * @throws Exception + */ + @Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") + public void childUnfiledRecordsFolderCanBeCreated() throws Exception + { + RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + + String parentFolderName = "Parent Folder " + getRandomAlphanumeric(); + String childFolderName = "Child Folder " + getRandomAlphanumeric(); + String childFolderTitle = childFolderName + " Title"; + String childFolderDescription = childFolderName + " Description"; + + // no need for fine control, create it using utility function + FilePlanComponent parentFolder = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), parentFolderName); + assertEquals(parentFolderName, parentFolder.getName()); + + // Build the record category properties + JsonObject unfiledFolderProperties = buildObject() + .add(NAME, childFolderName) + .add(NODE_TYPE, UNFILED_RECORD_FOLDER_TYPE.toString()) + .addObject(PROPERTIES) + .add(PROPERTIES_TITLE, childFolderTitle) + .add(PROPERTIES_DESCRIPTION, childFolderDescription) + .end() + .getJson(); + + // create it as a child of parentFolder + FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + parentFolder.getId()); + + // Verify the status code + restWrapper.assertStatusCodeIs(CREATED); + + // Verify the returned file plan component + assertFalse(childFolder.isIsCategory()); + assertFalse(childFolder.isIsFile()); + assertFalse(childFolder.isIsRecordFolder()); // it is not a _normal_ record folder! + + assertEquals(childFolder.getName(), childFolderName); + assertEquals(childFolder.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString()); + assertFalse(childFolder.isHasRetentionSchedule()); + + assertEquals(childFolder.getCreatedByUser().getId(), dataUser.getAdminUser().getUsername()); + + // Verify the returned file plan component properties + FilePlanComponentProperties childProperties = childFolder.getProperties(); + assertEquals(childProperties.getTitle(), childFolderTitle); + assertEquals(childProperties.getDescription(), childFolderDescription); + + // does this child point to its parent? + assertEquals(childFolder.getParentId(), parentFolder.getId()); + + // does child's parent point to it? + // perform another call as our parentFolder was executed before childFolder existed + FilePlanComponentsCollection parentsChildren = filePlanComponentAPI.listChildComponents(parentFolder.getId()); + restWrapper.assertStatusCodeIs(OK); + List childIds = parentsChildren.getEntries() + .stream() + .map(c -> c.getFilePlanComponent().getId()) + .collect(Collectors.toList()); + + // child folder is listed in parent + assertTrue(childIds.contains(childFolder.getId())); + + // there is only one child + assertEquals(1, childIds.size()); + } +} From b78970484ea740dafe604bbd8c1f76adaa770e20 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Tue, 15 Nov 2016 16:59:14 +0000 Subject: [PATCH 02/15] RM-4023: edit tests --- .../UnfiledRecordsFolderTests.java | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java index 4c44b2e196..1b67bb8bb2 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -83,7 +83,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest * Given the unfiled record container root * When I create an unfiled record folder via the ReST API * Then a root unfiled record folder is created - *
+ * * @throws Exception if folder couldn't be created */ @Test(description = "Create root unfiled records folder") @@ -238,4 +238,44 @@ public class UnfiledRecordsFolderTests extends BaseRestTest // there is only one child assertEquals(1, childIds.size()); } + + /** + * Given an unfiled record folder + * When I modify the unfiled record folder details via the ReST API + * Then the details of the unfiled record folder are modified + * + * @throws Exception + */ + @Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") + public void editUnfiledRecordsFolder() throws Exception + { + RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + String modified = "Modified "; + String folderName = "Folder To Modify" + getRandomAlphanumeric(); + + // no need for fine control, create it using utility function + FilePlanComponent folderToModify = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); + assertEquals(folderName, folderToModify.getName()); + + // Build the properties which will be updated + JsonObject updateFolderProperties = buildObject() + .add(NAME, modified + folderToModify.getName()) + .addObject(PROPERTIES) + .add(PROPERTIES_TITLE, modified + folderToModify.getProperties().getTitle()) + .add(PROPERTIES_DESCRIPTION, modified + folderToModify.getProperties().getDescription()) + .end() + .getJson(); + + // Update the unfiled records folder + FilePlanComponent renamedFolder = filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, + folderToModify.getId()); + + // Verify the status code + restWrapper.assertStatusCodeIs(OK); + + // Verify the returned file plan component + assertEquals(modified + folderToModify.getName(), renamedFolder.getName()); + assertEquals(modified + folderToModify.getProperties().getTitle(), renamedFolder.getProperties().getTitle()); + assertEquals(modified + folderToModify.getProperties().getDescription(), renamedFolder.getProperties().getDescription()); + } } From d991e65d6c15b3d019edd4cf0870142fb0d10282 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Tue, 15 Nov 2016 17:12:00 +0000 Subject: [PATCH 03/15] RM-4023: better check for PUT request --- .../rm/fileplancomponents/UnfiledRecordsFolderTests.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java index 1b67bb8bb2..97bc8a9fb7 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -246,7 +246,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest * * @throws Exception */ - @Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") + @Test(description = "Unfiled record folder") public void editUnfiledRecordsFolder() throws Exception { RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); @@ -267,11 +267,12 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .getJson(); // Update the unfiled records folder - FilePlanComponent renamedFolder = filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, - folderToModify.getId()); - + filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, folderToModify.getId()); // Verify the status code restWrapper.assertStatusCodeIs(OK); + + // this is to ensure the change was actually applied, rather than simply trusting the object returned by PUT + FilePlanComponent renamedFolder = filePlanComponentAPI.getFilePlanComponent(folderToModify.getId()); // Verify the returned file plan component assertEquals(modified + folderToModify.getName(), renamedFolder.getName()); From 837d7e22c6a6c5e0a4d964044a30b5ef19580947 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Wed, 16 Nov 2016 11:52:22 +0000 Subject: [PATCH 04/15] RM-4023: Delete test --- .../UnfiledRecordsFolderTests.java | 100 +++++++++++------- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java index 97bc8a9fb7..532b81bfb1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -11,14 +11,20 @@ */ package org.alfresco.rest.rm.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.*; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; @@ -28,22 +34,17 @@ import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.NoSuchElementException; import java.util.stream.Collectors; import com.google.gson.JsonObject; -import org.alfresco.rest.rm.base.BaseRestTest; import org.alfresco.rest.core.RestWrapper; +import org.alfresco.rest.rm.base.BaseRestTest; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentEntry; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; @@ -76,9 +77,6 @@ public class UnfiledRecordsFolderTests extends BaseRestTest TRANSFER_CONTAINER_TYPE, UNFILED_CONTAINER_TYPE); - // Number of children (for children creation test) - private static final int NUMBER_OF_CHILDREN = 10; - /** * Given the unfiled record container root * When I create an unfiled record folder via the ReST API @@ -142,28 +140,28 @@ public class UnfiledRecordsFolderTests extends BaseRestTest String folderDescription = folderName + " Description"; INVALID_ROOT_TYPES.stream() - .peek(a -> logger.info("creating " + a.toString())) - .forEach(t -> { - JsonObject unfiledFolderProperties = buildObject() - .add(NAME, folderName) - .add(NODE_TYPE, t.toString()) - .addObject(PROPERTIES) - .add(PROPERTIES_TITLE, folderTitle) - .add(PROPERTIES_DESCRIPTION, folderDescription) - .end() - .getJson(); - try - { - filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, - UNFILED_RECORDS_CONTAINER_ALIAS.toString()); - } - catch (Exception error) - { - } - - // Verify the status code - restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY); - }); + .peek(a -> logger.info("creating " + a.toString())) + .forEach(t -> { + JsonObject unfiledFolderProperties = buildObject() + .add(NAME, folderName) + .add(NODE_TYPE, t.toString()) + .addObject(PROPERTIES) + .add(PROPERTIES_TITLE, folderTitle) + .add(PROPERTIES_DESCRIPTION, folderDescription) + .end() + .getJson(); + try + { + filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + UNFILED_RECORDS_CONTAINER_ALIAS.toString()); + } + catch (Exception error) + { + } + + // Verify the status code + restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY); + }); } /** @@ -171,7 +169,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest * When I create an unfiled record folder via the ReST API * Then an unfiled record folder is created within the unfiled record folder * - * @throws Exception + * @throws Exception for failed actions */ @Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") public void childUnfiledRecordsFolderCanBeCreated() throws Exception @@ -244,7 +242,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest * When I modify the unfiled record folder details via the ReST API * Then the details of the unfiled record folder are modified * - * @throws Exception + * @throws Exception for failed actions */ @Test(description = "Unfiled record folder") public void editUnfiledRecordsFolder() throws Exception @@ -279,4 +277,32 @@ public class UnfiledRecordsFolderTests extends BaseRestTest assertEquals(modified + folderToModify.getProperties().getTitle(), renamedFolder.getProperties().getTitle()); assertEquals(modified + folderToModify.getProperties().getDescription(), renamedFolder.getProperties().getDescription()); } + + /** + * Given an unfiled record folder + * When I delete the unfiled record folder via the ReST API + * Then the unfiled record folder is deleted + * + * @throws Exception for failed actions + */ + @Test(description = "Delete unfiled record folder") + public void deleteUnfiledRecordsFolder() throws Exception + { + RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + String folderName = "Folder To Delete" + getRandomAlphanumeric(); + + // no need for fine control, create it using utility function + FilePlanComponent folderToModify = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); + assertEquals(folderName, folderToModify.getName()); + + // delete folderToModify + filePlanComponentAPI.deleteFilePlanComponent(folderToModify.getId()); + + // Verify the status code + restWrapper.assertStatusCodeIs(NO_CONTENT); + + // Deleted component should no longer be retrievable + filePlanComponentAPI.getFilePlanComponent(folderToModify.getId()); + restWrapper.assertStatusCodeIs(NOT_FOUND); + } } From 5262f62ed2068670e6f7a2bccb1dd717fa3bc283 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Wed, 16 Nov 2016 11:59:23 +0000 Subject: [PATCH 05/15] RM-4023: javadoc + minor code tidy-up --- .../UnfiledRecordsFolderTests.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java index 532b81bfb1..e35f078103 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -57,7 +57,7 @@ import org.testng.annotations.Test; * Unfiled Records folder CRUD API tests * * @author Kristijan Conkas - * @since 1.0 + * @since 2.6 */ public class UnfiledRecordsFolderTests extends BaseRestTest { @@ -67,7 +67,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest @Autowired private DataUser dataUser; - /** invalid root level types, at root level these shouldn't be possible to create */ + /** invalid root level types, at unfiled records root level these shouldn't be possible to create */ private static final List INVALID_ROOT_TYPES = Arrays.asList( FILE_PLAN_TYPE, RECORD_CATEGORY_TYPE, @@ -181,7 +181,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest String childFolderTitle = childFolderName + " Title"; String childFolderDescription = childFolderName + " Description"; - // no need for fine control, create it using utility function + // No need for fine control, create it using utility function FilePlanComponent parentFolder = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), parentFolderName); assertEquals(parentFolderName, parentFolder.getName()); @@ -195,7 +195,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .end() .getJson(); - // create it as a child of parentFolder + // Create it as a child of parentFolder FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, parentFolder.getId()); @@ -218,11 +218,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest assertEquals(childProperties.getTitle(), childFolderTitle); assertEquals(childProperties.getDescription(), childFolderDescription); - // does this child point to its parent? + // Does this child point to its parent? assertEquals(childFolder.getParentId(), parentFolder.getId()); - // does child's parent point to it? - // perform another call as our parentFolder was executed before childFolder existed + // Does child's parent point to it? + // Perform another call as our parentFolder had been executed before childFolder existed FilePlanComponentsCollection parentsChildren = filePlanComponentAPI.listChildComponents(parentFolder.getId()); restWrapper.assertStatusCodeIs(OK); List childIds = parentsChildren.getEntries() @@ -230,10 +230,10 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .map(c -> c.getFilePlanComponent().getId()) .collect(Collectors.toList()); - // child folder is listed in parent + // Child folder is listed in parent assertTrue(childIds.contains(childFolder.getId())); - // there is only one child + // There should be only one child assertEquals(1, childIds.size()); } @@ -251,7 +251,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest String modified = "Modified "; String folderName = "Folder To Modify" + getRandomAlphanumeric(); - // no need for fine control, create it using utility function + // No need for fine control, create it using utility function FilePlanComponent folderToModify = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); assertEquals(folderName, folderToModify.getName()); @@ -269,7 +269,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest // Verify the status code restWrapper.assertStatusCodeIs(OK); - // this is to ensure the change was actually applied, rather than simply trusting the object returned by PUT + // This is to ensure the change was actually applied, rather than simply trusting the object returned by PUT FilePlanComponent renamedFolder = filePlanComponentAPI.getFilePlanComponent(folderToModify.getId()); // Verify the returned file plan component @@ -291,18 +291,18 @@ public class UnfiledRecordsFolderTests extends BaseRestTest RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); String folderName = "Folder To Delete" + getRandomAlphanumeric(); - // no need for fine control, create it using utility function - FilePlanComponent folderToModify = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); - assertEquals(folderName, folderToModify.getName()); + // Create folderToDelete + FilePlanComponent folderToDelete = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); + assertEquals(folderName, folderToDelete.getName()); - // delete folderToModify - filePlanComponentAPI.deleteFilePlanComponent(folderToModify.getId()); + // Delete folderToDelete + filePlanComponentAPI.deleteFilePlanComponent(folderToDelete.getId()); // Verify the status code restWrapper.assertStatusCodeIs(NO_CONTENT); // Deleted component should no longer be retrievable - filePlanComponentAPI.getFilePlanComponent(folderToModify.getId()); + filePlanComponentAPI.getFilePlanComponent(folderToDelete.getId()); restWrapper.assertStatusCodeIs(NOT_FOUND); } } From 737d1d15a005a0f712dd377d0300c118824b24ec Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 16 Nov 2016 17:14:39 +0200 Subject: [PATCH 06/15] New test for RM-4367 --- .../FilePlanComponentType.java | 5 ++- .../org/alfresco/rest/rm/base/TestData.java | 29 +++++++++++++++ .../RecordCategoryTest.java | 37 ++++++++++++++++++- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java index aa4eda6563..e76c58c938 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java @@ -27,8 +27,11 @@ public enum FilePlanComponentType HOLD_TYPE("rma:hold"), UNFILED_RECORD_FOLDER_TYPE("rma:unfiledRecordFolder"), HOLD_CONTAINER_TYPE("rma:holdContainer"), + TRANSFER_TYPE("rma:transfer"), TRANSFER_CONTAINER_TYPE("rma:transferContainer"), - UNFILED_CONTAINER_TYPE("rma:unfiledRecordContainer"); + UNFILED_CONTAINER_TYPE("rma:unfiledRecordContainer"), + FOLDER_TYPE("cm:folder"), + CONTENT_TYPE("cm:content"); private String type; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java index 9adde5de57..46b634a7c1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java @@ -15,10 +15,15 @@ import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAli import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.HOLDS_ALIAS; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FOLDER_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_TYPE; import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; +import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import org.testng.annotations.DataProvider; @@ -98,4 +103,28 @@ public interface TestData * The default FOLDER title used when creating categories */ public static String FOLDER_TITLE = "FOLDER TITLE" + getRandomAlphanumeric(); + + + /** + * Data Provider with: + * with the object types not allowed as children for a record category + * + * @return file plan component alias + */ + @DataProvider + public static Object[][] childrenNotAllowedForCategory() + { + return new Object[][] { + { FILE_PLAN_TYPE.toString() }, + { TRANSFER_CONTAINER_TYPE.toString() }, + { HOLD_CONTAINER_TYPE.toString() }, + { UNFILED_CONTAINER_TYPE.toString() }, + { UNFILED_RECORD_FOLDER_TYPE.toString()}, + { HOLD_TYPE.toString()}, + { TRANSFER_TYPE.toString()}, + { FOLDER_TYPE.toString()}, + { CONTENT_TYPE.toString()} + }; + } + } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java index d1f18bd2eb..93f7137f2e 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java @@ -24,6 +24,7 @@ import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.NOT_FOUND; import static org.springframework.http.HttpStatus.NO_CONTENT; import static org.springframework.http.HttpStatus.OK; +import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; @@ -35,8 +36,9 @@ import java.util.NoSuchElementException; import com.google.gson.JsonObject; -import org.alfresco.rest.rm.base.BaseRestTest; import org.alfresco.rest.core.RestWrapper; +import org.alfresco.rest.rm.base.BaseRestTest; +import org.alfresco.rest.rm.base.TestData; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; @@ -333,6 +335,39 @@ public class RecordCategoryTest extends BaseRestTest }); } + /** + *
+     * Given that a record category exists
+     * When I ask to create a  object type which is not  a record category or a record folder as a child
+     * Then the children are not created  and the 422 response code is returned
+     */
+    @Test
+        (
+            description = "Create object types not allowed inside a category",
+            dataProviderClass = TestData.class,
+            dataProvider = "childrenNotAllowedForCategory"
+
+        )
+    public void createTypesNotAllowedInCategory(String nodeType) throws Exception
+    {
+        String COMPONENT_NAME="Component"+getRandomAlphanumeric();
+        // Authenticate with admin user
+        filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
+        FilePlanComponent category = createCategory(FILE_PLAN_ALIAS.toString(), COMPONENT_NAME);
+
+        JsonObject componentProperties = buildObject()
+            .add(NAME, COMPONENT_NAME)
+            .add(NODE_TYPE, nodeType)
+            .addObject(PROPERTIES)
+            .add(PROPERTIES_TITLE, "Title for " + COMPONENT_NAME)
+            .end()
+            .getJson();
+
+        FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(componentProperties, category.getId());
+        filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
+    }
+
+
     /**
      * Helper method to create child category
      *

From 401d211fa92b20936c5572c9fb78d9a524d783e5 Mon Sep 17 00:00:00 2001
From: Tuna Aksoy 
Date: Wed, 16 Nov 2016 22:18:42 +0000
Subject: [PATCH 07/15] RM-4347 (Restructure RM Projects)

---
 rm-automation/pom.xml                         | 14 ++++++++++++++
 .../rm-automation-community-rest-api/pom.xml  | 19 -------------------
 .../src/test/resources/testng.xml             |  1 -
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml
index 61a7768fbc..9b8f5ee2e1 100644
--- a/rm-automation/pom.xml
+++ b/rm-automation/pom.xml
@@ -25,6 +25,10 @@
 
    
       nightlybuilds
+      1.8
+      1.8
+      testng.xml
+      true
    
 
    
@@ -45,6 +49,16 @@
                
             
          
+         
+            maven-surefire-plugin
+            
+               false
+               
+                  ${project.build.testOutputDirectory}/${suiteXmlFile}
+               
+               ${skip.automationtests}
+            
+         
       
       
          
diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml
index 317d05f586..57e4a00054 100644
--- a/rm-automation/rm-automation-community-rest-api/pom.xml
+++ b/rm-automation/rm-automation-community-rest-api/pom.xml
@@ -12,10 +12,6 @@
    
 
    
-      1.8
-      1.8
-      testng.xml
-      true
       alfresco-rm-community-share
       alfresco-rm-community-repo
    
@@ -38,19 +34,4 @@
          2.0.0
       
    
-
-   
-      
-         
-            maven-surefire-plugin
-            
-               false
-               
-                  ${project.build.testOutputDirectory}/${suiteXmlFile}
-               
-               ${skip.automationtests}
-            
-         
-      
-   
 
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml b/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml
index ed47d376d7..c2d8684f0c 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml
+++ b/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml
@@ -1,7 +1,6 @@
 
 
 
-
    
       
          

From 3406a078f736f68291786e3c5919bf6adcb0b6cb Mon Sep 17 00:00:00 2001
From: Tuna Aksoy 
Date: Wed, 16 Nov 2016 22:46:27 +0000
Subject: [PATCH 08/15] RM-4347: Added license header

---
 .../rm-automation-community-rest-api/pom.xml  | 14 ++++++++++
 .../fileplancomponents/FilePlanComponent.java | 21 ++++++++++++---
 .../FilePlanComponentAlias.java               | 21 ++++++++++++---
 .../FilePlanComponentEntry.java               | 21 ++++++++++++---
 .../FilePlanComponentFields.java              | 21 ++++++++++++---
 .../FilePlanComponentIdNamePair.java          | 21 ++++++++++++---
 .../FilePlanComponentPath.java                | 21 ++++++++++++---
 .../FilePlanComponentProperties.java          | 21 ++++++++++++---
 .../FilePlanComponentType.java                | 21 ++++++++++++---
 .../FilePlanComponentUserInfo.java            | 21 ++++++++++++---
 .../FilePlanComponentsCollection.java         | 21 ++++++++++++---
 .../fileplancomponents/ReviewPeriod.java      | 26 +++++++++++++++++++
 .../alfresco/rest/rm/model/site/RMSite.java   | 21 ++++++++++++---
 .../rest/rm/model/site/RMSiteCompliance.java  | 21 ++++++++++++---
 .../rest/rm/model/site/RMSiteFields.java      | 21 ++++++++++++---
 .../rm/requests/FilePlanComponentAPI.java     | 21 ++++++++++++---
 .../alfresco/rest/rm/requests/RMSiteAPI.java  | 21 ++++++++++++---
 .../alfresco/rest/rm/util/ParameterCheck.java | 21 ++++++++++++---
 .../rest/rm/base/AllowableOperations.java     | 21 ++++++++++++---
 .../alfresco/rest/rm/base/BaseRestTest.java   | 21 ++++++++++++---
 .../org/alfresco/rest/rm/base/TestData.java   | 21 ++++++++++++---
 .../rm/fileplancomponents/FilePlanTests.java  | 21 ++++++++++++---
 .../RecordCategoryTest.java                   | 21 ++++++++++++---
 .../fileplancomponents/RecordFolderTests.java | 21 ++++++++++++---
 .../alfresco/rest/rm/site/RMSiteTests.java    | 21 ++++++++++++---
 25 files changed, 454 insertions(+), 69 deletions(-)

diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml
index 57e4a00054..b0da41c27b 100644
--- a/rm-automation/rm-automation-community-rest-api/pom.xml
+++ b/rm-automation/rm-automation-community-rest-api/pom.xml
@@ -16,6 +16,20 @@
       alfresco-rm-community-repo
    
 
+   
+      
+         
+            org.codehaus.mojo
+            license-maven-plugin
+            
+               alfresco_community
+               file:${project.parent.parent.basedir}/license
+               ${project.parent.parent.basedir}/license/description.ftl
+            
+         
+      
+   
+
    
       
          org.alfresco.tas
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java
index 0843a5e840..3767db5ee0 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java
index e5929014f8..8a3089c8d2 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java
index 70bd836090..e3dd8af20d 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java
index 9d8415d960..19c72a6983 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java
index a7d5f1f9c3..0a7ea51705 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java
index 3e75c01396..359fabb67c 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java
index a7179e831a..a39959d8be 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java
index 498be5e202..2e26b47421 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java
index 7983cd9250..a7b18f564e 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java
index 5cee5e7629..98a8182650 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java
index c96a2bc9f9..463984e108 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java
@@ -1,3 +1,29 @@
+/*
+ * #%L
+ * Alfresco Records Management Module
+ * %%
+ * Copyright (C) 2005 - 2016 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 .
+ * #L%
+ */
 package org.alfresco.rest.rm.model.fileplancomponents;
 
 /**
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java
index 08846558f9..57c52aca06 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.site;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java
index 96b16a678d..a8b50ae55f 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.site;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java
index 4dd9cf918d..995f12e9e8 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.model.site;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java
index a29146e434..c9d765e118 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.requests;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
index 11e5ca45ba..c99e9c4555 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.requests;
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java
index 462d832ff4..684e59ba04 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.util;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java
index e50a7f07ff..da75239e34 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.base;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java
index 089120d436..d03548f455 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.base;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java
index 45acbf1662..c53a415f9e 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.base;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java
index 3c9bb4b5a2..db163c026b 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
index 2a6c30f329..f5de7d2665 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java
index 9b0fd45e1a..96756c44c6 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.fileplancomponents;
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java
index 3919935fac..0d5d50515c 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java
@@ -4,9 +4,24 @@
  * %%
  * Copyright (C) 2005 - 2016 Alfresco Software Limited
  * %%
- * License rights for this program may be obtained from Alfresco Software, Ltd.
- * pursuant to a written agreement and any use of this program without such an
- * agreement is prohibited.
+ * 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 .
  * #L%
  */
 package org.alfresco.rest.rm.site;

From 102d9a6a75ac751a5158c22b8293cf8fd9f9c22f Mon Sep 17 00:00:00 2001
From: Rodica Sutu 
Date: Thu, 17 Nov 2016 10:07:11 +0200
Subject: [PATCH 09/15] minor updates

---
 .../rm/fileplancomponents/RecordCategoryTest.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
index 93f7137f2e..5e259d4603 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
@@ -336,18 +336,17 @@ public class RecordCategoryTest extends BaseRestTest
     }
 
     /**
-     * 
      * Given that a record category exists
      * When I ask to create a  object type which is not  a record category or a record folder as a child
      * Then the children are not created  and the 422 response code is returned
      */
     @Test
-        (
-            description = "Create object types not allowed inside a category",
-            dataProviderClass = TestData.class,
-            dataProvider = "childrenNotAllowedForCategory"
+    (
+        description = "Create node types not allowed inside a category",
+        dataProviderClass = TestData.class,
+        dataProvider = "childrenNotAllowedForCategory"
 
-        )
+    )
     public void createTypesNotAllowedInCategory(String nodeType) throws Exception
     {
         String COMPONENT_NAME="Component"+getRandomAlphanumeric();
@@ -355,6 +354,7 @@ public class RecordCategoryTest extends BaseRestTest
         filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
         FilePlanComponent category = createCategory(FILE_PLAN_ALIAS.toString(), COMPONENT_NAME);
 
+        //Build node  properties
         JsonObject componentProperties = buildObject()
             .add(NAME, COMPONENT_NAME)
             .add(NODE_TYPE, nodeType)
@@ -363,6 +363,7 @@ public class RecordCategoryTest extends BaseRestTest
             .end()
             .getJson();
 
+        //create the invalid node type
         FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(componentProperties, category.getId());
         filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
     }

From c5560f24db161f883e08fa37950825a58f9b77a2 Mon Sep 17 00:00:00 2001
From: Kristijan Conkas 
Date: Thu, 17 Nov 2016 09:23:35 +0000
Subject: [PATCH 10/15] RM-4023: fixed CI findings

---
 .../UnfiledRecordsFolderTests.java            | 78 ++++++++++---------
 1 file changed, 42 insertions(+), 36 deletions(-)

diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java
index e35f078103..542ebdb7b0 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java
@@ -36,7 +36,6 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -51,6 +50,7 @@ import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollectio
 import org.alfresco.rest.rm.requests.FilePlanComponentAPI;
 import org.alfresco.utility.data.DataUser;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 /**
@@ -68,14 +68,18 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
     private DataUser dataUser;
 
     /** invalid root level types, at unfiled records root level these shouldn't be possible to create */
-    private static final List INVALID_ROOT_TYPES = Arrays.asList(
-        FILE_PLAN_TYPE,
-        RECORD_CATEGORY_TYPE,
-        RECORD_FOLDER_TYPE,
-        HOLD_TYPE,
-        HOLD_CONTAINER_TYPE,
-        TRANSFER_CONTAINER_TYPE,
-        UNFILED_CONTAINER_TYPE);
+    @DataProvider(name = "invalidRootTypes")
+    public Object[][] createData1() {
+     return new Object[][] {
+       { FILE_PLAN_TYPE },
+       { RECORD_CATEGORY_TYPE },
+       { RECORD_FOLDER_TYPE },
+       { HOLD_TYPE },
+       { HOLD_CONTAINER_TYPE },
+       { TRANSFER_CONTAINER_TYPE },
+       { UNFILED_CONTAINER_TYPE }
+     };
+    }
     
     /**
      * Given the unfiled record container root
@@ -94,7 +98,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
         String folderTitle = folderName + " Title";
         String folderDescription = folderName + " Description";
         
-        // Build the record category properties
+        // Build unfiled records folder properties
         JsonObject unfiledFolderProperties = buildObject()
             .add(NAME, folderName)
             .add(NODE_TYPE, UNFILED_RECORD_FOLDER_TYPE.toString())
@@ -130,8 +134,12 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
     /**
      * Negative test to verify only unfiled record folders can be created at root level
      */
-    @Test(description = "Only unfiled records folders can be created at unfiled records root level")
-    public void onlyRecordFoldersCanBeCreatedAtUnfiledRecordsRoot()
+    @Test
+    (
+        dataProvider = "invalidRootTypes",
+        description = "Only unfiled records folders can be created at unfiled records root level"
+    )
+    public void onlyRecordFoldersCanBeCreatedAtUnfiledRecordsRoot(FilePlanComponentType componentType)
     {
         RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
 
@@ -139,29 +147,27 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
         String folderTitle = folderName + " Title";
         String folderDescription = folderName + " Description";
 
-        INVALID_ROOT_TYPES.stream()
-            .peek(a -> logger.info("creating " + a.toString()))
-            .forEach(t -> {
-                JsonObject unfiledFolderProperties = buildObject()
-                    .add(NAME, folderName)
-                    .add(NODE_TYPE, t.toString())
-                    .addObject(PROPERTIES)
-                    .add(PROPERTIES_TITLE, folderTitle)
-                    .add(PROPERTIES_DESCRIPTION, folderDescription)
-                    .end()
-                    .getJson();
-                try
-                {
-                    filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, 
-                        UNFILED_RECORDS_CONTAINER_ALIAS.toString());
-                }
-                catch (Exception error)
-                {
-                }
-    
-                // Verify the status code
-                restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY);
-            });
+        logger.info("creating " + componentType.toString());
+        
+        JsonObject unfiledFolderProperties = buildObject()
+            .add(NAME, folderName)
+            .add(NODE_TYPE, componentType.toString())
+            .addObject(PROPERTIES)
+            .add(PROPERTIES_TITLE, folderTitle)
+            .add(PROPERTIES_DESCRIPTION, folderDescription)
+            .end()
+            .getJson();
+        try
+        {
+            filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, 
+                UNFILED_RECORDS_CONTAINER_ALIAS.toString());
+        }
+        catch (Exception error)
+        {
+        }
+
+        // Verify the status code
+        restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY);
     }
     
     /**
@@ -185,7 +191,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
         FilePlanComponent parentFolder = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), parentFolderName);
         assertEquals(parentFolderName, parentFolder.getName());
      
-        // Build the record category properties
+        // Build the unfiled records folder properties
         JsonObject unfiledFolderProperties = buildObject()
             .add(NAME, childFolderName)
             .add(NODE_TYPE, UNFILED_RECORD_FOLDER_TYPE.toString())

From bf194339499d1778f51e83604f6f66debbe762bc Mon Sep 17 00:00:00 2001
From: Rodica Sutu 
Date: Thu, 17 Nov 2016 11:29:47 +0200
Subject: [PATCH 11/15] add the bug id

---
 .../alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
index 5e259d4603..78d527e30a 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java
@@ -45,6 +45,7 @@ import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType;
 import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection;
 import org.alfresco.rest.rm.requests.FilePlanComponentAPI;
 import org.alfresco.utility.data.DataUser;
+import org.alfresco.utility.report.Bug;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.testng.annotations.Test;
 
@@ -347,6 +348,7 @@ public class RecordCategoryTest extends BaseRestTest
         dataProvider = "childrenNotAllowedForCategory"
 
     )
+    @Bug (id="RM-4367")
     public void createTypesNotAllowedInCategory(String nodeType) throws Exception
     {
         String COMPONENT_NAME="Component"+getRandomAlphanumeric();

From b2ee0adb7ea76b3e019ea427c06945a25b80a219 Mon Sep 17 00:00:00 2001
From: Tuna Aksoy 
Date: Thu, 17 Nov 2016 12:21:52 +0000
Subject: [PATCH 12/15] Integrate RM Community REST API Automation into RM UI
 Automation

---
 .../alfresco/rest/rm/requests/RMSiteAPI.java  | 24 +++++++++++++++++++
 .../alfresco/rest/rm/base/BaseRestTest.java   | 13 +---------
 .../rm/fileplancomponents/FilePlanTests.java  |  2 +-
 .../alfresco/rest/rm/site/RMSiteTests.java    | 14 ++++++-----
 4 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
index c99e9c4555..e246873943 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java
@@ -33,11 +33,14 @@ import static org.springframework.http.HttpMethod.DELETE;
 import static org.springframework.http.HttpMethod.GET;
 import static org.springframework.http.HttpMethod.POST;
 import static org.springframework.http.HttpMethod.PUT;
+import static org.springframework.http.HttpStatus.OK;
 
 import com.google.gson.JsonObject;
 
 import org.alfresco.rest.core.RestAPI;
 import org.alfresco.rest.rm.model.site.RMSite;
+import org.alfresco.utility.data.DataUser;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -52,6 +55,9 @@ import org.springframework.stereotype.Component;
 @Scope (value = "prototype")
 public class RMSiteAPI extends RestAPI
 {
+    @Autowired
+    private DataUser dataUser;
+
     /**
      * Get the RM site
      *
@@ -139,4 +145,22 @@ public class RMSiteAPI extends RestAPI
                 "ig-sites/rm"
         ));
     }
+
+    /**
+     * Checks if the RM site exists or not
+     *
+     * @return true if the RM site exists, false otherwise.
+     * @throws Exception for the following cases:
+     * 
    + *
  • Api Response code 400 Invalid parameter: GET request is supported only for the RM site
  • + *
  • Api Response code 401 If authentication failed
  • + *
  • Api Response code 409 If RM Site does not exist
  • + *
  • Api Response code default Unexpected error
  • + */ + public boolean existsRMSite() throws Exception + { + usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + getSite(); + return usingRestWrapper().getStatusCode().equals(OK.toString()); + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java index d03548f455..8dbc74d6a6 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java @@ -42,7 +42,6 @@ import static org.alfresco.rest.rm.model.site.RMSiteFields.DESCRIPTION; import static org.alfresco.rest.rm.model.site.RMSiteFields.TITLE; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; -import static org.springframework.http.HttpStatus.OK; import com.google.gson.JsonObject; import com.jayway.restassured.RestAssured; @@ -123,7 +122,7 @@ public class BaseRestTest extends RestTest public void createRMSiteIfNotExists() throws Exception { // Check RM site doesn't exist - if (!siteRMExists()) + if (!rmSiteAPI.existsRMSite()) { rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); @@ -142,16 +141,6 @@ public class BaseRestTest extends RestTest } } - /** - * Check if the RM site exists via the GET request - */ - public boolean siteRMExists() throws Exception - { - RestWrapper restWrapper = rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); - rmSiteAPI.getSite(); - return restWrapper.getStatusCode().equals(OK.toString()); - } - /** * Helper method to create child category * diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java index db163c026b..07ac808fb5 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java @@ -94,7 +94,7 @@ public class FilePlanTests extends BaseRestTest public void getFilePlanComponentWhenRMIsNotCreated(String filePlanAlias) throws Exception { // Check RM Site Exist - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete RM Site rmSiteAPI.deleteRMSite(); diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java index 0d5d50515c..6163eb29c1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java @@ -94,7 +94,7 @@ public class RMSiteTests extends BaseRestTest rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); // Check if the RM site exists - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete the RM site rmSiteAPI.deleteRMSite(); @@ -192,16 +192,18 @@ public class RMSiteTests extends BaseRestTest // Authenticate with admin user RestWrapper restWrapper = rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); - // Get the RM site - RMSite rmSite = rmSiteAPI.getSite(); - if (!siteRMExists()) + // Check if RM Site exists + if (!rmSiteAPI.existsRMSite()) { - // Verify the status code when RM site doesn't exist + // Verify the status code when RM site doesn't exist restWrapper.assertStatusCodeIs(NOT_FOUND); createRMSiteIfNotExists(); } else { + // Get the RM site + RMSite rmSite = rmSiteAPI.getSite(); + // Verify the status code restWrapper.assertStatusCodeIs(OK); assertEquals(rmSite.getId(), RM_ID); @@ -227,7 +229,7 @@ public class RMSiteTests extends BaseRestTest rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); // Check if the RM site exists - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete the RM site rmSiteAPI.deleteRMSite(); From 7fece7a20c182599f11c359442f7457cf0ab151c Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 17 Nov 2016 12:51:09 +0000 Subject: [PATCH 13/15] Fixed compilation issue due to licence header changes in RM Community REST API Automation project --- .../RecordCategoryTest.java | 2 +- .../UnfiledRecordsFolderTests.java | 89 +++++++++++-------- 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java index f324ba505a..d23bc44398 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java @@ -381,7 +381,7 @@ public class RecordCategoryTest extends BaseRestTest .getJson(); //create the invalid node type - FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(componentProperties, category.getId()); + filePlanComponentAPI.createFilePlanComponent(componentProperties, category.getId()); filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY); } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java index 542ebdb7b0..2045897c56 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java @@ -4,9 +4,24 @@ * %% * Copyright (C) 2005 - 2016 Alfresco Software Limited * %% - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * 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 . * #L% */ package org.alfresco.rest.rm.fileplancomponents; @@ -80,12 +95,12 @@ public class UnfiledRecordsFolderTests extends BaseRestTest { UNFILED_CONTAINER_TYPE } }; } - + /** * Given the unfiled record container root * When I create an unfiled record folder via the ReST API * Then a root unfiled record folder is created - * + * * @throws Exception if folder couldn't be created */ @Test(description = "Create root unfiled records folder") @@ -93,11 +108,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest { // Authenticate with admin user RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); - + String folderName = "Folder " + getRandomAlphanumeric(); String folderTitle = folderName + " Title"; String folderDescription = folderName + " Description"; - + // Build unfiled records folder properties JsonObject unfiledFolderProperties = buildObject() .add(NAME, folderName) @@ -107,13 +122,13 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .add(PROPERTIES_DESCRIPTION, folderDescription) .end() .getJson(); - - FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + + FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, UNFILED_RECORDS_CONTAINER_ALIAS.toString()); // Verify the status code - restWrapper.assertStatusCodeIs(CREATED); - + restWrapper.assertStatusCodeIs(CREATED); + // Verify the returned file plan component assertFalse(filePlanComponent.isIsCategory()); assertFalse(filePlanComponent.isIsFile()); @@ -130,7 +145,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest assertEquals(filePlanComponentProperties.getTitle(), folderTitle); assertEquals(filePlanComponentProperties.getDescription(), folderDescription); } - + /** * Negative test to verify only unfiled record folders can be created at root level */ @@ -148,7 +163,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest String folderDescription = folderName + " Description"; logger.info("creating " + componentType.toString()); - + JsonObject unfiledFolderProperties = buildObject() .add(NAME, folderName) .add(NODE_TYPE, componentType.toString()) @@ -159,7 +174,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .getJson(); try { - filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, UNFILED_RECORDS_CONTAINER_ALIAS.toString()); } catch (Exception error) @@ -169,12 +184,12 @@ public class UnfiledRecordsFolderTests extends BaseRestTest // Verify the status code restWrapper.assertStatusCodeIs(UNPROCESSABLE_ENTITY); } - + /** * Given an unfiled record folder * When I create an unfiled record folder via the ReST API * Then an unfiled record folder is created within the unfiled record folder - * + * * @throws Exception for failed actions */ @Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") @@ -186,11 +201,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest String childFolderName = "Child Folder " + getRandomAlphanumeric(); String childFolderTitle = childFolderName + " Title"; String childFolderDescription = childFolderName + " Description"; - + // No need for fine control, create it using utility function FilePlanComponent parentFolder = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), parentFolderName); assertEquals(parentFolderName, parentFolder.getName()); - + // Build the unfiled records folder properties JsonObject unfiledFolderProperties = buildObject() .add(NAME, childFolderName) @@ -200,14 +215,14 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .add(PROPERTIES_DESCRIPTION, childFolderDescription) .end() .getJson(); - + // Create it as a child of parentFolder - FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, + FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolderProperties, parentFolder.getId()); // Verify the status code - restWrapper.assertStatusCodeIs(CREATED); - + restWrapper.assertStatusCodeIs(CREATED); + // Verify the returned file plan component assertFalse(childFolder.isIsCategory()); assertFalse(childFolder.isIsFile()); @@ -223,11 +238,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest FilePlanComponentProperties childProperties = childFolder.getProperties(); assertEquals(childProperties.getTitle(), childFolderTitle); assertEquals(childProperties.getDescription(), childFolderDescription); - + // Does this child point to its parent? assertEquals(childFolder.getParentId(), parentFolder.getId()); - - // Does child's parent point to it? + + // Does child's parent point to it? // Perform another call as our parentFolder had been executed before childFolder existed FilePlanComponentsCollection parentsChildren = filePlanComponentAPI.listChildComponents(parentFolder.getId()); restWrapper.assertStatusCodeIs(OK); @@ -235,19 +250,19 @@ public class UnfiledRecordsFolderTests extends BaseRestTest .stream() .map(c -> c.getFilePlanComponent().getId()) .collect(Collectors.toList()); - + // Child folder is listed in parent assertTrue(childIds.contains(childFolder.getId())); - + // There should be only one child - assertEquals(1, childIds.size()); + assertEquals(1, childIds.size()); } - + /** * Given an unfiled record folder * When I modify the unfiled record folder details via the ReST API * Then the details of the unfiled record folder are modified - * + * * @throws Exception for failed actions */ @Test(description = "Unfiled record folder") @@ -256,11 +271,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); String modified = "Modified "; String folderName = "Folder To Modify" + getRandomAlphanumeric(); - + // No need for fine control, create it using utility function FilePlanComponent folderToModify = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); assertEquals(folderName, folderToModify.getName()); - + // Build the properties which will be updated JsonObject updateFolderProperties = buildObject() .add(NAME, modified + folderToModify.getName()) @@ -274,7 +289,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, folderToModify.getId()); // Verify the status code restWrapper.assertStatusCodeIs(OK); - + // This is to ensure the change was actually applied, rather than simply trusting the object returned by PUT FilePlanComponent renamedFolder = filePlanComponentAPI.getFilePlanComponent(folderToModify.getId()); @@ -283,12 +298,12 @@ public class UnfiledRecordsFolderTests extends BaseRestTest assertEquals(modified + folderToModify.getProperties().getTitle(), renamedFolder.getProperties().getTitle()); assertEquals(modified + folderToModify.getProperties().getDescription(), renamedFolder.getProperties().getDescription()); } - + /** * Given an unfiled record folder * When I delete the unfiled record folder via the ReST API * Then the unfiled record folder is deleted - * + * * @throws Exception for failed actions */ @Test(description = "Delete unfiled record folder") @@ -296,11 +311,11 @@ public class UnfiledRecordsFolderTests extends BaseRestTest { RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); String folderName = "Folder To Delete" + getRandomAlphanumeric(); - + // Create folderToDelete FilePlanComponent folderToDelete = createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), folderName); assertEquals(folderName, folderToDelete.getName()); - + // Delete folderToDelete filePlanComponentAPI.deleteFilePlanComponent(folderToDelete.getId()); From 0a1c6340e29e72af4f805e4cec3ebb8323b689c0 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 17 Nov 2016 19:51:37 +0000 Subject: [PATCH 14/15] Changed package name org.alfresco.rest.rm to org.alfresco.rest.rm.community for RM Community REST API Automation project --- .../fileplancomponents/FilePlanComponent.java | 8 ++-- .../FilePlanComponentAlias.java | 4 +- .../FilePlanComponentEntry.java | 4 +- .../FilePlanComponentFields.java | 2 +- .../FilePlanComponentIdNamePair.java | 2 +- .../FilePlanComponentPath.java | 2 +- .../FilePlanComponentProperties.java | 16 +++---- .../FilePlanComponentType.java | 4 +- .../FilePlanComponentUserInfo.java | 2 +- .../FilePlanComponentsCollection.java | 2 +- .../fileplancomponents/ReviewPeriod.java | 2 +- .../rm/{ => community}/model/site/RMSite.java | 2 +- .../model/site/RMSiteCompliance.java | 2 +- .../model/site/RMSiteFields.java | 2 +- .../requests/FilePlanComponentAPI.java | 10 ++--- .../{ => community}/requests/RMSiteAPI.java | 6 +-- .../{ => community}/util/ParameterCheck.java | 2 +- .../base/AllowableOperations.java | 2 +- .../rm/{ => community}/base/BaseRestTest.java | 36 ++++++++-------- .../rm/{ => community}/base/TestData.java | 28 ++++++------- .../fileplancomponents/FilePlanTests.java | 34 +++++++-------- .../RecordCategoryTest.java | 30 ++++++------- .../fileplancomponents/RecordFolderTests.java | 42 +++++++++---------- .../UnfiledRecordsFolderTests.java | 42 +++++++++---------- .../rm/{ => community}/site/RMSiteTests.java | 24 +++++------ .../src/test/resources/testng.xml | 2 +- 26 files changed, 156 insertions(+), 156 deletions(-) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponent.java (95%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentAlias.java (93%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentEntry.java (90%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentFields.java (97%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentIdNamePair.java (96%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentPath.java (97%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentProperties.java (82%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentType.java (94%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentUserInfo.java (96%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/FilePlanComponentsCollection.java (95%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/fileplancomponents/ReviewPeriod.java (96%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/site/RMSite.java (97%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/site/RMSiteCompliance.java (95%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/model/site/RMSiteFields.java (97%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/requests/FilePlanComponentAPI.java (95%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/requests/RMSiteAPI.java (96%) rename rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/{ => community}/util/ParameterCheck.java (98%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/base/AllowableOperations.java (96%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/base/BaseRestTest.java (81%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/base/TestData.java (73%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/fileplancomponents/FilePlanTests.java (90%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/fileplancomponents/RecordCategoryTest.java (92%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/fileplancomponents/RecordFolderTests.java (88%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/fileplancomponents/UnfiledRecordsFolderTests.java (86%) rename rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/{ => community}/site/RMSiteTests.java (93%) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java similarity index 95% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java index 3767db5ee0..05a8eeea9b 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponent.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java @@ -24,11 +24,11 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.ALLOWABLE_OPERATIONS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.ALLOWABLE_OPERATIONS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; import java.util.List; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAlias.java similarity index 93% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAlias.java index 8a3089c8d2..11268d55c0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentAlias.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentAlias.java @@ -24,9 +24,9 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; -import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryString; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString; /** * File plan component alias enumeration diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentEntry.java similarity index 90% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentEntry.java index e3dd8af20d..7d88b233c8 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentEntry.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentEntry.java @@ -24,9 +24,9 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.ENTRY; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.ENTRY; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java similarity index 97% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java index 19c72a6983..4775e67fa9 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentFields.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; /** * File plan component field names constants diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentIdNamePair.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentIdNamePair.java index 0a7ea51705..c6c0e55dc7 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentIdNamePair.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentIdNamePair.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; /** * POJO for id/name pair diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentPath.java similarity index 97% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentPath.java index 359fabb67c..bee8bbac4a 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentPath.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentPath.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; import java.util.List; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java similarity index 82% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java index a39959d8be..588d406ea1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentProperties.java @@ -24,15 +24,15 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_HOLD_REASON; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SUPPLEMENTAL_MARKING_LIST; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_HOLD_REASON; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SUPPLEMENTAL_MARKING_LIST; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR; import java.util.List; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java similarity index 94% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java index bd23e29878..1308a68295 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentType.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentType.java @@ -24,9 +24,9 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; -import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryString; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString; /** * File plan component type enumeration diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentUserInfo.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentUserInfo.java index a7b18f564e..58773d1fd7 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentUserInfo.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentUserInfo.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; /** * POJO for file plan component created by object diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentsCollection.java similarity index 95% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentsCollection.java index 98a8182650..4cb32feb62 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/FilePlanComponentsCollection.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponentsCollection.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; import org.alfresco.rest.core.RestModels; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/ReviewPeriod.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/ReviewPeriod.java index 463984e108..87f4929197 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/fileplancomponents/ReviewPeriod.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/ReviewPeriod.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.fileplancomponents; +package org.alfresco.rest.rm.community.model.fileplancomponents; /** * POJO for the review period diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSite.java similarity index 97% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSite.java index 57c52aca06..cc6c72b27e 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSite.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSite.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.site; +package org.alfresco.rest.rm.community.model.site; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteCompliance.java similarity index 95% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteCompliance.java index a8b50ae55f..ab53c5fc47 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteCompliance.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteCompliance.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.site; +package org.alfresco.rest.rm.community.model.site; /** * RM Site compliance diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteFields.java similarity index 97% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteFields.java index 995f12e9e8..5135e79736 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/model/site/RMSiteFields.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/site/RMSiteFields.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.model.site; +package org.alfresco.rest.rm.community.model.site; /** *RM Site properties from the RM Model Schema diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java similarity index 95% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java index c9d765e118..760b9772b3 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/FilePlanComponentAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/FilePlanComponentAPI.java @@ -24,12 +24,12 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.requests; +package org.alfresco.rest.rm.community.requests; import static org.alfresco.rest.core.RestRequest.requestWithBody; import static org.alfresco.rest.core.RestRequest.simpleRequest; -import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryObject; -import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryString; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryObject; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString; import static org.springframework.http.HttpMethod.DELETE; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.POST; @@ -38,8 +38,8 @@ import static org.springframework.http.HttpMethod.PUT; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestAPI; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentsCollection; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java index c99e9c4555..38e982deea 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/requests/RMSiteAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java @@ -24,11 +24,11 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.requests; +package org.alfresco.rest.rm.community.requests; import static org.alfresco.rest.core.RestRequest.requestWithBody; import static org.alfresco.rest.core.RestRequest.simpleRequest; -import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryObject; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryObject; import static org.springframework.http.HttpMethod.DELETE; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.POST; @@ -37,7 +37,7 @@ import static org.springframework.http.HttpMethod.PUT; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestAPI; -import org.alfresco.rest.rm.model.site.RMSite; +import org.alfresco.rest.rm.community.model.site.RMSite; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/ParameterCheck.java similarity index 98% rename from rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java rename to rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/ParameterCheck.java index 684e59ba04..6fafae9f7c 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/util/ParameterCheck.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/ParameterCheck.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.util; +package org.alfresco.rest.rm.community.util; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/AllowableOperations.java similarity index 96% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/AllowableOperations.java index da75239e34..7922c82613 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/AllowableOperations.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/AllowableOperations.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.base; +package org.alfresco.rest.rm.community.base; /** * List of allowable operations diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java similarity index 81% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java index 4621434508..654ae21c12 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/BaseRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java @@ -24,23 +24,23 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.base; +package org.alfresco.rest.rm.community.base; import static java.lang.Integer.parseInt; -import static org.alfresco.rest.rm.base.TestData.CATEGORY_TITLE; -import static org.alfresco.rest.rm.base.TestData.FOLDER_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; -import static org.alfresco.rest.rm.model.site.RMSiteCompliance.STANDARD; -import static org.alfresco.rest.rm.model.site.RMSiteFields.COMPLIANCE; -import static org.alfresco.rest.rm.model.site.RMSiteFields.DESCRIPTION; -import static org.alfresco.rest.rm.model.site.RMSiteFields.TITLE; +import static org.alfresco.rest.rm.community.base.TestData.CATEGORY_TITLE; +import static org.alfresco.rest.rm.community.base.TestData.FOLDER_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.site.RMSiteCompliance.STANDARD; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.COMPLIANCE; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.DESCRIPTION; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.TITLE; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.OK; @@ -50,10 +50,10 @@ import com.jayway.restassured.RestAssured; import org.alfresco.rest.RestTest; import org.alfresco.rest.core.RestWrapper; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; -import org.alfresco.rest.rm.requests.FilePlanComponentAPI; -import org.alfresco.rest.rm.requests.RMSiteAPI; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType; +import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.requests.RMSiteAPI; import org.alfresco.utility.data.DataUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java similarity index 73% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java index 7c4e8494c3..43c9147d5f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/base/TestData.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java @@ -24,21 +24,21 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.base; +package org.alfresco.rest.rm.community.base; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.HOLDS_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FOLDER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.HOLDS_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import org.testng.annotations.DataProvider; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java similarity index 90% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java index c8c1609fa4..925e4d6395 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/FilePlanTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java @@ -24,19 +24,19 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.fileplancomponents; +package org.alfresco.rest.rm.community.fileplancomponents; import static java.util.Arrays.asList; -import static org.alfresco.rest.rm.base.AllowableOperations.CREATE; -import static org.alfresco.rest.rm.base.AllowableOperations.DELETE; -import static org.alfresco.rest.rm.base.AllowableOperations.UPDATE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.base.AllowableOperations.CREATE; +import static org.alfresco.rest.rm.community.base.AllowableOperations.DELETE; +import static org.alfresco.rest.rm.community.base.AllowableOperations.UPDATE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.FORBIDDEN; @@ -49,13 +49,13 @@ import static org.testng.Assert.assertTrue; import com.google.gson.JsonObject; -import org.alfresco.rest.rm.base.BaseRestTest; -import org.alfresco.rest.rm.base.TestData; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; -import org.alfresco.rest.rm.requests.FilePlanComponentAPI; -import org.alfresco.rest.rm.requests.RMSiteAPI; +import org.alfresco.rest.rm.community.base.BaseRestTest; +import org.alfresco.rest.rm.community.base.TestData; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType; +import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.requests.RMSiteAPI; import org.alfresco.utility.data.DataUser; import org.alfresco.utility.model.UserModel; import org.alfresco.utility.report.Bug; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordCategoryTest.java similarity index 92% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordCategoryTest.java index d23bc44398..8b1e4cac09 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordCategoryTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordCategoryTest.java @@ -24,15 +24,15 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.fileplancomponents; +package org.alfresco.rest.rm.community.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; @@ -52,13 +52,13 @@ import java.util.NoSuchElementException; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestWrapper; -import org.alfresco.rest.rm.base.BaseRestTest; -import org.alfresco.rest.rm.base.TestData; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; -import org.alfresco.rest.rm.requests.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.base.BaseRestTest; +import org.alfresco.rest.rm.community.base.TestData; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentsCollection; +import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI; import org.alfresco.utility.data.DataUser; import org.alfresco.utility.report.Bug; import org.springframework.beans.factory.annotation.Autowired; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordFolderTests.java similarity index 88% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordFolderTests.java index 96756c44c6..fee7b46171 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/RecordFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordFolderTests.java @@ -24,22 +24,22 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.fileplancomponents; +package org.alfresco.rest.rm.community.fileplancomponents; -import static org.alfresco.rest.rm.base.TestData.CATEGORY_NAME; -import static org.alfresco.rest.rm.base.TestData.FOLDER_NAME; -import static org.alfresco.rest.rm.base.TestData.FOLDER_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.base.TestData.CATEGORY_NAME; +import static org.alfresco.rest.rm.community.base.TestData.FOLDER_NAME; +import static org.alfresco.rest.rm.community.base.TestData.FOLDER_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; @@ -59,12 +59,12 @@ import java.util.NoSuchElementException; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestWrapper; -import org.alfresco.rest.rm.base.BaseRestTest; -import org.alfresco.rest.rm.base.TestData; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; -import org.alfresco.rest.rm.requests.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.base.BaseRestTest; +import org.alfresco.rest.rm.community.base.TestData; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentsCollection; +import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI; import org.alfresco.utility.data.DataUser; import org.alfresco.utility.report.Bug; import org.springframework.beans.factory.annotation.Autowired; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/UnfiledRecordsFolderTests.java similarity index 86% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/UnfiledRecordsFolderTests.java index 2045897c56..329131b95c 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/fileplancomponents/UnfiledRecordsFolderTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/UnfiledRecordsFolderTests.java @@ -24,22 +24,22 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.fileplancomponents; +package org.alfresco.rest.rm.community.fileplancomponents; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NAME; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; -import static org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NAME; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.NODE_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.HOLD_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.HOLD_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; @@ -57,12 +57,12 @@ import java.util.stream.Collectors; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestWrapper; -import org.alfresco.rest.rm.base.BaseRestTest; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponent; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentProperties; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentType; -import org.alfresco.rest.rm.model.fileplancomponents.FilePlanComponentsCollection; -import org.alfresco.rest.rm.requests.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.base.BaseRestTest; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentsCollection; +import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI; import org.alfresco.utility.data.DataUser; import org.springframework.beans.factory.annotation.Autowired; import org.testng.annotations.DataProvider; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java similarity index 93% rename from rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java rename to rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java index 0d5d50515c..6b74d413d1 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java @@ -24,16 +24,16 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rest.rm.site; +package org.alfresco.rest.rm.community.site; -import static org.alfresco.rest.rm.base.TestData.ANOTHER_ADMIN; -import static org.alfresco.rest.rm.base.TestData.DEFAULT_EMAIL; -import static org.alfresco.rest.rm.base.TestData.DEFAULT_PASSWORD; -import static org.alfresco.rest.rm.model.site.RMSiteCompliance.DOD5015; -import static org.alfresco.rest.rm.model.site.RMSiteCompliance.STANDARD; -import static org.alfresco.rest.rm.model.site.RMSiteFields.COMPLIANCE; -import static org.alfresco.rest.rm.model.site.RMSiteFields.DESCRIPTION; -import static org.alfresco.rest.rm.model.site.RMSiteFields.TITLE; +import static org.alfresco.rest.rm.community.base.TestData.ANOTHER_ADMIN; +import static org.alfresco.rest.rm.community.base.TestData.DEFAULT_EMAIL; +import static org.alfresco.rest.rm.community.base.TestData.DEFAULT_PASSWORD; +import static org.alfresco.rest.rm.community.model.site.RMSiteCompliance.DOD5015; +import static org.alfresco.rest.rm.community.model.site.RMSiteCompliance.STANDARD; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.COMPLIANCE; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.DESCRIPTION; +import static org.alfresco.rest.rm.community.model.site.RMSiteFields.TITLE; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.CONFLICT; @@ -49,10 +49,10 @@ import static org.testng.Assert.assertNotNull; import com.google.gson.JsonObject; import org.alfresco.dataprep.UserService; -import org.alfresco.rest.rm.base.BaseRestTest; +import org.alfresco.rest.rm.community.base.BaseRestTest; +import org.alfresco.rest.rm.community.model.site.RMSite; +import org.alfresco.rest.rm.community.requests.RMSiteAPI; import org.alfresco.rest.core.RestWrapper; -import org.alfresco.rest.rm.model.site.RMSite; -import org.alfresco.rest.rm.requests.RMSiteAPI; import org.alfresco.utility.constants.UserRole; import org.alfresco.utility.data.DataUser; import org.alfresco.utility.data.RandomData; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml b/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml index c2d8684f0c..5686b980a6 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml +++ b/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file From c55a2634c035608d40933d81dbe9815fbb811e6a Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 17 Nov 2016 20:57:17 +0000 Subject: [PATCH 15/15] Added existsRMSite method to RMSiteAPI --- .../rest/rm/community/requests/RMSiteAPI.java | 25 +++++++++++++++++++ .../rest/rm/community/base/BaseRestTest.java | 15 ++--------- .../fileplancomponents/FilePlanTests.java | 2 +- .../rest/rm/community/site/RMSiteTests.java | 12 +++++---- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java index 38e982deea..d855db885d 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/RMSiteAPI.java @@ -33,11 +33,14 @@ import static org.springframework.http.HttpMethod.DELETE; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.HttpMethod.POST; import static org.springframework.http.HttpMethod.PUT; +import static org.springframework.http.HttpStatus.OK; import com.google.gson.JsonObject; import org.alfresco.rest.core.RestAPI; import org.alfresco.rest.rm.community.model.site.RMSite; +import org.alfresco.utility.data.DataUser; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -52,6 +55,9 @@ import org.springframework.stereotype.Component; @Scope (value = "prototype") public class RMSiteAPI extends RestAPI { + @Autowired + private DataUser dataUser; + /** * Get the RM site * @@ -139,4 +145,23 @@ public class RMSiteAPI extends RestAPI "ig-sites/rm" )); } + + /** + * Checks if the RM site exists or not + * + * @return true if the RM site exists, false otherwise + * @throws Exception for the following cases: + *
      + *
    • Api Response code 400 Invalid parameter: GET request is supported only for the RM site
    • + *
    • Api Response code 401 If authentication failed
    • + *
    • Api Response code 409 If RM Site does not exist
    • + *
    • Api Response code default Unexpected error
    • + *
    + */ + public boolean existsRMSite() throws Exception + { + usingRestWrapper().authenticateUser(dataUser.getAdminUser()); + getSite(); + return usingRestWrapper().getStatusCode().equals(OK.toString()); + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java index 654ae21c12..1006b79e52 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java @@ -43,7 +43,6 @@ import static org.alfresco.rest.rm.community.model.site.RMSiteFields.DESCRIPTION import static org.alfresco.rest.rm.community.model.site.RMSiteFields.TITLE; import static org.jglue.fluentjson.JsonBuilderFactory.buildObject; import static org.springframework.http.HttpStatus.CREATED; -import static org.springframework.http.HttpStatus.OK; import com.google.gson.JsonObject; import com.jayway.restassured.RestAssured; @@ -124,7 +123,7 @@ public class BaseRestTest extends RestTest public void createRMSiteIfNotExists() throws Exception { // Check RM site doesn't exist - if (!siteRMExists()) + if (!rmSiteAPI.existsRMSite()) { rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); @@ -143,16 +142,6 @@ public class BaseRestTest extends RestTest } } - /** - * Check if the RM site exists via the GET request - */ - public boolean siteRMExists() throws Exception - { - RestWrapper restWrapper = rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); - rmSiteAPI.getSite(); - return restWrapper.getStatusCode().equals(OK.toString()); - } - /** * Helper method to create child category * @@ -191,7 +180,7 @@ public class BaseRestTest extends RestTest { return createComponent(parentId, folderName, UNFILED_RECORD_FOLDER_TYPE, FOLDER_TITLE); } - + /** * Helper method to create generic child component * diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java index 925e4d6395..f719271d60 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java @@ -94,7 +94,7 @@ public class FilePlanTests extends BaseRestTest public void getFilePlanComponentWhenRMIsNotCreated(String filePlanAlias) throws Exception { // Check RM Site Exist - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete RM Site rmSiteAPI.deleteRMSite(); diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java index 6b74d413d1..4193ad70d6 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java @@ -94,7 +94,7 @@ public class RMSiteTests extends BaseRestTest rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); // Check if the RM site exists - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete the RM site rmSiteAPI.deleteRMSite(); @@ -192,9 +192,8 @@ public class RMSiteTests extends BaseRestTest // Authenticate with admin user RestWrapper restWrapper = rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); - // Get the RM site - RMSite rmSite = rmSiteAPI.getSite(); - if (!siteRMExists()) + // Check if RM site exists + if (!rmSiteAPI.existsRMSite()) { // Verify the status code when RM site doesn't exist restWrapper.assertStatusCodeIs(NOT_FOUND); @@ -202,6 +201,9 @@ public class RMSiteTests extends BaseRestTest } else { + // Get the RM site + RMSite rmSite = rmSiteAPI.getSite(); + // Verify the status code restWrapper.assertStatusCodeIs(OK); assertEquals(rmSite.getId(), RM_ID); @@ -227,7 +229,7 @@ public class RMSiteTests extends BaseRestTest rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); // Check if the RM site exists - if (siteRMExists()) + if (rmSiteAPI.existsRMSite()) { // Delete the RM site rmSiteAPI.deleteRMSite();