From 889c831bdabb94bbfe19e4fb7159cc02f3ad5f05 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 4 Jan 2017 16:47:28 +0200 Subject: [PATCH 1/6] add tests for File Action --- .../fileplancomponents/RecordBodyFile.java | 56 +++++ .../requests/igCoreAPI/RecordsAPI.java | 66 +++++- .../rest/rm/community/base/TestData.java | 13 +- .../fileplancomponents/FileRecordsTests.java | 223 ++++++++++++++++++ .../fileplancomponents/ReadRecordTests.java | 3 +- 5 files changed, 356 insertions(+), 5 deletions(-) create mode 100644 rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/RecordBodyFile.java create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/RecordBodyFile.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/RecordBodyFile.java new file mode 100644 index 0000000000..4576c386f1 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/RecordBodyFile.java @@ -0,0 +1,56 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2017 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.community.model.fileplancomponents; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.alfresco.utility.model.TestModel; + +/** + * POJO for File records + * + * @author Rodica Sutu + * @since 2.6 + */ +@Builder +@Data +@EqualsAndHashCode (callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +public class RecordBodyFile extends TestModel +{ + @JsonProperty + private String targetParentId; + + @JsonProperty + private String relativePath; +} diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java index 07d2b5a099..a60a91ef55 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java @@ -28,13 +28,20 @@ package org.alfresco.rest.rm.community.requests.igCoreAPI; import static com.jayway.restassured.RestAssured.given; +import static org.alfresco.rest.core.RestRequest.requestWithBody; +import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryObject; import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString; +import static org.alfresco.rest.rm.community.util.PojoUtility.toJson; +import static org.apache.commons.lang3.StringUtils.EMPTY; +import static org.springframework.http.HttpMethod.POST; import com.jayway.restassured.response.Response; import org.alfresco.rest.core.RMRestWrapper; import org.alfresco.rest.core.RestRequest; import org.alfresco.rest.model.RestHtmlResponse; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.RecordBodyFile; import org.alfresco.rest.rm.community.requests.RMModelRequest; import org.springframework.context.annotation.Scope; import org.springframework.http.HttpMethod; @@ -84,7 +91,7 @@ public class RecordsAPI extends RMModelRequest } /** - * Get the html content for the electronic record + * Get the html response for the electronic record * * @param recordId The id of the electronic record * @return The content for the given record id @@ -102,4 +109,61 @@ public class RecordsAPI extends RMModelRequest RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "records/{recordId}/content", recordId); return getRMRestWrapper().processHtmlResponse(request); } + + /** + * File the record recordId into file plan structure based on the location sent via the request body + * + * @param recordBodyFile The properties where to file the record + * @param recordId The id of the record to file + * @return The {@link FilePlanComponent} with the given properties + * @throws Exception for the following cases: + * + */ + public FilePlanComponent fileRecord(RecordBodyFile recordBodyFile, String recordId) throws Exception + { + mandatoryObject("recordBodyFile", recordBodyFile); + mandatoryString("recordId", recordId); + + return fileRecord(recordBodyFile, recordId, EMPTY); + } + + /** + * Creates a file plan component with the given properties under the parent node with the given id + * + * @param filePlanComponentModel The properties of the file plan component to be created + * @param parameters The URL parameters to add + * @param parentId The id of the parent where the new file plan component should be created + * @return The {@link FilePlanComponent} with the given properties + * @throws Exception for the following cases: + * + */ + public FilePlanComponent fileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters) throws Exception + { + mandatoryObject("requestBodyFile", recordBodyFile); + mandatoryString("recordId", recordId); + + return getRMRestWrapper().processModel(FilePlanComponent.class, requestWithBody( + POST, + toJson(recordBodyFile), + "/records/{recordId}/file?{parameters}", + recordId, + parameters + )); + } + } + diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java index 4c5f6840ec..167f79ae20 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java @@ -110,16 +110,23 @@ public interface TestData public static String CATEGORY_TITLE = "CATEGORY TITLE" + getRandomAlphanumeric(); /** - * The default FOLDER name used when creating categories + * The default FOLDER name used when creating folders */ public static String FOLDER_NAME = "FOLDER NAME" + getRandomAlphanumeric(); /** - * The default FOLDER title used when creating categories + * The default FOLDER title used when creating folders */ public static String FOLDER_TITLE = "FOLDER TITLE" + getRandomAlphanumeric(); - + /** + * The default electronic record name used when creating electronic records + */ + public static String ELECTRONIC_RECORD_NAME = "Record electronic" + getRandomAlphanumeric(); + /** + * The default Non electronic record name used when creating non-electronic records + */ + public static String NONELECTRONIC_RECORD_NAME = "Record nonelectronic" + getRandomAlphanumeric(); /** * Data Provider with: * with the object types not allowed as children for a record category diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java new file mode 100644 index 0000000000..2312c2f593 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java @@ -0,0 +1,223 @@ +package org.alfresco.rest.rm.community.fileplancomponents; + +import static org.alfresco.rest.rm.community.base.TestData.ELECTRONIC_RECORD_NAME; +import static org.alfresco.rest.rm.community.base.TestData.NONELECTRONIC_RECORD_NAME; +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.NON_ELECTRONIC_RECORD_TYPE; +import static org.springframework.http.HttpStatus.CREATED; +import static org.springframework.http.HttpStatus.FORBIDDEN; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.AssertJUnit.assertTrue; + +import org.alfresco.rest.rm.community.base.BaseRMRestTest; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentContent; +import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; +import org.alfresco.rest.rm.community.model.fileplancomponents.RecordBodyFile; +import org.testng.annotations.Test; + +/** + * This class contains the tests for + * File Unfiled Record Action REST API + * + * @author Rodica Sutu + * @since 2.6 + */ +public class FileRecordsTests extends BaseRMRestTest +{ + private FilePlanComponent electronicRecord = FilePlanComponent.builder() + .name(ELECTRONIC_RECORD_NAME) + .nodeType(CONTENT_TYPE.toString()) + .content(FilePlanComponentContent.builder().mimeType("text/plain").build()) + .build(); + + private FilePlanComponent nonelectronicRecord = FilePlanComponent.builder() + .properties(FilePlanComponentProperties.builder() + .description(NONELECTRONIC_RECORD_NAME) + .title("Title") + .build()) + .name(NONELECTRONIC_RECORD_NAME) + .nodeType(NON_ELECTRONIC_RECORD_TYPE.toString()) + .build(); + /** + * Given an unfiled record in the root unfiled record container or a unfiled record folder + * And an open record folder + * When I file the unfiled record into the record folder + * Then the record is filed + */ + @Test + public void fileRecordIntoExistingFolder() throws Exception + { + //create a record folder + String folderId = createCategoryFolderInFilePlan().getId(); + + //create records + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + + //file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); + FilePlanComponent recordFiled =getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + //check the response status + assertStatusCode(CREATED); + //check the parent id for the record returned + assertEquals(recordFiled.getParentId(),folderId); + //check the record is filed into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c->c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //file the non-electronic record into the folder created + FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); + //check the response status code + assertStatusCode(CREATED); + //check the parent id for the record returned + assertEquals(nonElectRecordFiled.getParentId(), folderId); + //check the record is added into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + } + + /** + * Given an unfiled record in the root unfiled record container or a unfiled record folder + * And a closed record folder + * When I file the unfiled record into the record folder + * Then I get an unsupported operation exception + * + */ + @Test + public void fileRecordIntoCloseFolder() throws Exception + { + //create a record folder + String folderId = createCategoryFolderInFilePlan().getId(); + closeFolder(folderId); + //create records + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + + //file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); + getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + //check the response status + assertStatusCode(FORBIDDEN); + + //check the record is filed into the record folder + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //file the non-electronic record into the folder created + FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); + //check the response status code + assertStatusCode(FORBIDDEN); + //check the record is added into the record folder + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + } + + /** + * Given a filed record in a record folder + * And an open record folder + * When I file the filed record into the record folder + * Then the record is filed in both locations + */ + @Test + public void linkRecordInto() throws Exception + { + //create a record folder + String parentFolderId = createCategoryFolderInFilePlan().getId(); + + //create records + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElect = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + + //file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(parentFolderId).build(); + FilePlanComponent recordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + FilePlanComponent nonElectronicFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); + //check the response status + assertStatusCode(CREATED); + + //create the second folder + String folderToLink = createCategoryFolderInFilePlan().getId(); + recordBodyFile = RecordBodyFile.builder().targetParentId(folderToLink).build(); + + //check the response status + assertStatusCode(CREATED); + //link the electronic record + FilePlanComponent recordLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + assertTrue(recordLink.getParentId().equals(parentFolderId)); + //check the response status code + assertStatusCode(CREATED); + //link the nonelectronic record + FilePlanComponent nonElectronicLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); + assertStatusCode(CREATED); + assertTrue(recordLink.getParentId().equals(parentFolderId)); + + //check the record is added into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(parentFolderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordFiled.getId())&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) + ) + ); + //check the record doesn't exist into unfiled record container + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderToLink) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordFiled.getId()) && c.getFilePlanComponentModel().getParentId().equals(parentFolderId) + ) + ); + + } + + /** + * Given an unfiled or filed record + * And a container that is NOT a record folder + * When I file the unfiled or filed record to the container + * Then I get an unsupported operation exception + */ + +} diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/ReadRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/ReadRecordTests.java index f1dba007c5..fe7a9eb4cc 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/ReadRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/ReadRecordTests.java @@ -357,7 +357,8 @@ public class ReadRecordTests extends BaseRMRestTest assertTrue(filePlanComponent.getName().startsWith(createdComponent.getName())); assertEquals(createdComponent.getNodeType(), filePlanComponent.getNodeType()); - } catch (NoSuchElementException e) + } + catch (NoSuchElementException e) { fail("No child element for " + filePlanComponent.getId()); } From dfff6ab6f1c04bbb1c7067af4fe149a8a697a53b Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 4 Jan 2017 18:45:33 +0200 Subject: [PATCH 2/6] add more tests for File Unfilled records --- .../fileplancomponents/FileRecordsTests.java | 69 ++++++++++++++++++- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java index 2312c2f593..d0f47c029c 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java @@ -2,9 +2,15 @@ package org.alfresco.rest.rm.community.fileplancomponents; import static org.alfresco.rest.rm.community.base.TestData.ELECTRONIC_RECORD_NAME; import static org.alfresco.rest.rm.community.base.TestData.NONELECTRONIC_RECORD_NAME; +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.NON_ELECTRONIC_RECORD_TYPE; +import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createTempFile; +import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; +import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.FORBIDDEN; import static org.testng.Assert.assertEquals; @@ -16,6 +22,8 @@ import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentContent; import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; import org.alfresco.rest.rm.community.model.fileplancomponents.RecordBodyFile; +import org.alfresco.utility.report.Bug; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; /** @@ -164,6 +172,7 @@ public class FileRecordsTests extends BaseRMRestTest * Then the record is filed in both locations */ @Test + @Bug(id="RM-4578") public void linkRecordInto() throws Exception { //create a record folder @@ -192,9 +201,9 @@ public class FileRecordsTests extends BaseRMRestTest //check the response status code assertStatusCode(CREATED); //link the nonelectronic record - FilePlanComponent nonElectronicLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); + FilePlanComponent nonElectronicLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, nonElectronicFiled.getId()); assertStatusCode(CREATED); - assertTrue(recordLink.getParentId().equals(parentFolderId)); + assertTrue(nonElectronicLink.getParentId().equals(parentFolderId)); //check the record is added into the record folder assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(parentFolderId) @@ -204,13 +213,29 @@ public class FileRecordsTests extends BaseRMRestTest ) ); //check the record doesn't exist into unfiled record container + //TODO add a check after the issue will be fixed RM-4578 assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderToLink) .getEntries().stream() .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordFiled.getId()) && c.getFilePlanComponentModel().getParentId().equals(parentFolderId) + .equals(recordFiled.getId()) //&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) ) ); + //check the record is added into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(parentFolderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(nonElectronicFiled.getId()) && c.getFilePlanComponentModel().getParentId().equals(parentFolderId) + ) + ); + //check the record doesn't exist into unfiled record container + //TODO add a check after the issue will be fixed RM-4578 + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderToLink) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(nonElectronicFiled.getId()) //&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) + ) + ); } /** @@ -219,5 +244,43 @@ public class FileRecordsTests extends BaseRMRestTest * When I file the unfiled or filed record to the container * Then I get an unsupported operation exception */ + /** + * Valid root containers where electronic and non-electronic records can be created + */ + @DataProvider (name = "invalidContainersForFile") + public Object[][] getFolderContainers() throws Exception + { + return new Object[][] { + { getFilePlanComponent(FILE_PLAN_ALIAS).getId()}, + { getFilePlanComponent(UNFILED_RECORDS_CONTAINER_ALIAS).getId()}, + { getFilePlanComponent(HOLDS_ALIAS).getId() }, + { getFilePlanComponent(TRANSFERS_ALIAS).getId() }, + // an arbitrary record category + { createCategory(getAdminUser(), FILE_PLAN_ALIAS, "Category " + getRandomAlphanumeric()).getId()}, + // an arbitrary unfiled records folder + { createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()).getId() } + }; + } + @Test + ( + dataProvider = "invalidContainersForFile", + description = "File the unfiled record to the container that is not a record foldr" + ) + public void invalidContainerToFile(String containerId) throws Exception + { + + //create records + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElect = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + + //file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(containerId).build(); + getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + assertStatusCode(BAD_REQUEST); + + getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); + //check the response status + assertStatusCode(BAD_REQUEST); + } } From fab44d39d924ea93414075690d89a4ba4871bd68 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Wed, 4 Jan 2017 19:39:15 +0200 Subject: [PATCH 3/6] RM-4430 - added missing header --- .../fileplancomponents/FileRecordsTests.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java index d0f47c029c..08b37501f9 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java @@ -1,3 +1,29 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2017 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.community.fileplancomponents; import static org.alfresco.rest.rm.community.base.TestData.ELECTRONIC_RECORD_NAME; From 650070c107525fe8d228a8b2dd1db981a7782854 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 4 Jan 2017 20:31:23 +0200 Subject: [PATCH 4/6] - updates and add tests --- .../requests/igCoreAPI/RecordsAPI.java | 41 +++---- .../fileplancomponents/FileRecordsTests.java | 109 ++++++++++++++++-- 2 files changed, 119 insertions(+), 31 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java index be6d8f8321..292ed2da97 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java @@ -119,14 +119,15 @@ public class RecordsAPI extends RMModelRequest * @param recordId The id of the record to file * @return The {@link FilePlanComponent} with the given properties * @throws Exception for the following cases: - *
    - *
  • {@code fileplanComponentId} is not a valid format
  • - *
  • authentication fails
  • - *
  • current user does not have permission to add children to {@code fileplanComponentId}
  • - *
  • {@code fileplanComponentId} does not exist
  • - *
  • new name clashes with an existing node in the current parent container
  • - *
  • model integrity exception, including node name with invalid characters
  • - *
+ *
    + *
  • Invalid parameter: {@code recordBodyFile} is not a valid format,{@code recordId} is not a record
  • + *
  • authentication fails
  • + *
  • current user does not have permission to file to {@code fileplanComponentId}
  • + *
  • {@code recordId} does not exist
  • + *
  • targetParentId from recordBodyFile does not exist
  • + *
  • model integrity exception: the action breaks system's integrity restrictions
  • + *
+ * */ public FilePlanComponent fileRecord(RecordBodyFile recordBodyFile, String recordId) throws Exception { @@ -137,21 +138,21 @@ public class RecordsAPI extends RMModelRequest } /** - * Creates a file plan component with the given properties under the parent node with the given id + * File the record recordId into file plan structure based on the location sent via the request body * - * @param filePlanComponentModel The properties of the file plan component to be created - * @param parameters The URL parameters to add - * @param parentId The id of the parent where the new file plan component should be created + * @param recordBodyFile The properties where to file the record + * @param recordId The id of the record to file * @return The {@link FilePlanComponent} with the given properties * @throws Exception for the following cases: - *
    - *
  • {@code fileplanComponentId} is not a valid format
  • - *
  • authentication fails
  • - *
  • current user does not have permission to add children to {@code fileplanComponentId}
  • - *
  • {@code fileplanComponentId} does not exist
  • - *
  • new name clashes with an existing node in the current parent container
  • - *
  • model integrity exception, including node name with invalid characters
  • - *
+ *
    + *
  • Invalid parameter: {@code recordBodyFile} is not a valid format,{@code recordId} is not a record
  • + *
  • authentication fails
  • + *
  • current user does not have permission to file to {@code fileplanComponentId}
  • + *
  • {@code recordId} does not exist
  • + *
  • targetParentId from recordBodyFile does not exist
  • + *
  • model integrity exception: the action breaks system's integrity restrictions
  • + *
+ * */ public FilePlanComponent fileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters) throws Exception { diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java index d0f47c029c..5bc9b4e68e 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java @@ -55,15 +55,32 @@ public class FileRecordsTests extends BaseRMRestTest * When I file the unfiled record into the record folder * Then the record is filed */ + /** + * Unfiled containers from where record can be filed + */ + @DataProvider (name = "unfiledContainer") + public Object[][] getUnfiledContainer() throws Exception + { + return new Object[][] { + //unfiled container + { getFilePlanComponent(UNFILED_RECORDS_CONTAINER_ALIAS).getId() }, + // an arbitrary unfiled records folder + { createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()).getId() } + }; + } @Test - public void fileRecordIntoExistingFolder() throws Exception + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers " + ) + public void fileRecordIntoExistingFolder(String unfiledContainerId) throws Exception { //create a record folder String folderId = createCategoryFolderInFilePlan().getId(); //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); - FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); //file the record into the folder created RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); @@ -80,7 +97,7 @@ public class FileRecordsTests extends BaseRMRestTest ) ); //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) .getEntries().stream() .anyMatch(c -> c.getFilePlanComponentModel().getId() .equals(recordElectronic.getId()) @@ -100,7 +117,7 @@ public class FileRecordsTests extends BaseRMRestTest ) ); //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) .getEntries().stream() .anyMatch(c -> c.getFilePlanComponentModel().getId() .equals(recordNonElectId.getId()) @@ -116,14 +133,18 @@ public class FileRecordsTests extends BaseRMRestTest * */ @Test - public void fileRecordIntoCloseFolder() throws Exception + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers into a closed folder " + ) + public void fileRecordIntoCloseFolder(String unfiledContainerId) throws Exception { //create a record folder String folderId = createCategoryFolderInFilePlan().getId(); closeFolder(folderId); //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); - FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); //file the record into the folder created RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); @@ -139,7 +160,7 @@ public class FileRecordsTests extends BaseRMRestTest ) ); //check the record doesn't exist into unfiled record container - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) .getEntries().stream() .anyMatch(c -> c.getFilePlanComponentModel().getId() .equals(recordElectronic.getId()) @@ -157,7 +178,7 @@ public class FileRecordsTests extends BaseRMRestTest ) ); //check the record doesn't exist into unfiled record container - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(UNFILED_RECORDS_CONTAINER_ALIAS) + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) .getEntries().stream() .anyMatch(c -> c.getFilePlanComponentModel().getId() .equals(recordNonElectId.getId()) @@ -245,7 +266,7 @@ public class FileRecordsTests extends BaseRMRestTest * Then I get an unsupported operation exception */ /** - * Valid root containers where electronic and non-electronic records can be created + * Invalid containers where electronic and non-electronic records can be filed */ @DataProvider (name = "invalidContainersForFile") public Object[][] getFolderContainers() throws Exception @@ -283,4 +304,70 @@ public class FileRecordsTests extends BaseRMRestTest assertStatusCode(BAD_REQUEST); } + /** + * Given an unfiled record in the root unfiled record container or a unfiled record folder + * When I file the unfiled record into the record folder using the relativePath + * Then the filePlan structure from relativePath is created and the record is filed into the specified path + */ + @Test + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers " + ) + public void fileRecordIntoRelativePath(String unfiledContainerId) throws Exception + { + //create a record folder + String RELATIVE_PATH = "CATEGORY" + getRandomAlphanumeric() + "/FOLDER"; + + //create records + FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); + + //file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().relativePath(RELATIVE_PATH).build(); + FilePlanComponent recordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + + //check the response status + assertStatusCode(CREATED); + + //Get the folder ID created + String folderId= getRestAPIFactory().getFilePlanComponentsAPI().getFilePlanComponent(FILE_PLAN_ALIAS, "relativePath="+RELATIVE_PATH).getId(); + //check the parent id for the record returned + assertEquals(recordFiled.getParentId(), folderId); + //check the record is filed into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordElectronic.getId()) + ) + ); + //file the non-electronic record into the folder created + FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); + //check the response status code + assertStatusCode(CREATED); + //check the parent id for the record returned + assertEquals(nonElectRecordFiled.getParentId(), folderId); + //check the record is added into the record folder + assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + //check the record doesn't exist into unfiled record container + assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId() + .equals(recordNonElectId.getId()) + ) + ); + } + } From abb6178ed4edcdc1e4b52ac96a488510d70bedae Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Thu, 5 Jan 2017 11:06:52 +0000 Subject: [PATCH 5/6] RM-4430: Pre-merge import and javadoc tidy-up, minor improvements --- .../requests/igCoreAPI/RecordsAPI.java | 2 +- .../rm/community/base/BaseRMRestTest.java | 5 - .../fileplancomponents/FileRecordsTests.java | 520 +++++++++--------- 3 files changed, 263 insertions(+), 264 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java index 292ed2da97..8ad7e6a012 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/igCoreAPI/RecordsAPI.java @@ -48,7 +48,7 @@ import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; /** - *Records REST API Wrapper + * Records REST API Wrapper * *@author Rodica Sutu *@since 2.6 diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index b8840f41da..cc1db1e740 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -39,11 +39,6 @@ import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.OK; -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStreamWriter; -import java.nio.charset.Charset; - import org.alfresco.rest.RestTest; import org.alfresco.rest.core.RestAPIFactory; import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java index f95cea13b3..57a15021f6 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FileRecordsTests.java @@ -48,6 +48,8 @@ import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentContent; import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties; import org.alfresco.rest.rm.community.model.fileplancomponents.RecordBodyFile; +import org.alfresco.rest.rm.community.requests.igCoreAPI.FilePlanComponentAPI; +import org.alfresco.rest.rm.community.requests.igCoreAPI.RecordsAPI; import org.alfresco.utility.report.Bug; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -75,12 +77,7 @@ public class FileRecordsTests extends BaseRMRestTest .name(NONELECTRONIC_RECORD_NAME) .nodeType(NON_ELECTRONIC_RECORD_TYPE.toString()) .build(); - /** - * Given an unfiled record in the root unfiled record container or a unfiled record folder - * And an open record folder - * When I file the unfiled record into the record folder - * Then the record is filed - */ + /** * Unfiled containers from where record can be filed */ @@ -94,203 +91,7 @@ public class FileRecordsTests extends BaseRMRestTest { createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()).getId() } }; } - @Test - ( - dataProvider = "unfiledContainer", - description = "File record from unfiled containers " - ) - public void fileRecordIntoExistingFolder(String unfiledContainerId) throws Exception - { - //create a record folder - String folderId = createCategoryFolderInFilePlan().getId(); - - //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); - FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); - - //file the record into the folder created - RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); - FilePlanComponent recordFiled =getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); - //check the response status - assertStatusCode(CREATED); - //check the parent id for the record returned - assertEquals(recordFiled.getParentId(),folderId); - //check the record is filed into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c->c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //file the non-electronic record into the folder created - FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); - //check the response status code - assertStatusCode(CREATED); - //check the parent id for the record returned - assertEquals(nonElectRecordFiled.getParentId(), folderId); - //check the record is added into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); - } - - /** - * Given an unfiled record in the root unfiled record container or a unfiled record folder - * And a closed record folder - * When I file the unfiled record into the record folder - * Then I get an unsupported operation exception - * - */ - @Test - ( - dataProvider = "unfiledContainer", - description = "File record from unfiled containers into a closed folder " - ) - public void fileRecordIntoCloseFolder(String unfiledContainerId) throws Exception - { - //create a record folder - String folderId = createCategoryFolderInFilePlan().getId(); - closeFolder(folderId); - //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); - FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); - - //file the record into the folder created - RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); - getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); - //check the response status - assertStatusCode(FORBIDDEN); - - //check the record is filed into the record folder - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //file the non-electronic record into the folder created - FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); - //check the response status code - assertStatusCode(FORBIDDEN); - //check the record is added into the record folder - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); - } - - /** - * Given a filed record in a record folder - * And an open record folder - * When I file the filed record into the record folder - * Then the record is filed in both locations - */ - @Test - @Bug(id="RM-4578") - public void linkRecordInto() throws Exception - { - //create a record folder - String parentFolderId = createCategoryFolderInFilePlan().getId(); - - //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); - FilePlanComponent recordNonElect = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); - - //file the record into the folder created - RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(parentFolderId).build(); - FilePlanComponent recordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); - FilePlanComponent nonElectronicFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); - //check the response status - assertStatusCode(CREATED); - - //create the second folder - String folderToLink = createCategoryFolderInFilePlan().getId(); - recordBodyFile = RecordBodyFile.builder().targetParentId(folderToLink).build(); - - //check the response status - assertStatusCode(CREATED); - //link the electronic record - FilePlanComponent recordLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); - assertTrue(recordLink.getParentId().equals(parentFolderId)); - //check the response status code - assertStatusCode(CREATED); - //link the nonelectronic record - FilePlanComponent nonElectronicLink = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, nonElectronicFiled.getId()); - assertStatusCode(CREATED); - assertTrue(nonElectronicLink.getParentId().equals(parentFolderId)); - - //check the record is added into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(parentFolderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordFiled.getId())&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) - ) - ); - //check the record doesn't exist into unfiled record container - //TODO add a check after the issue will be fixed RM-4578 - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderToLink) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordFiled.getId()) //&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) - ) - ); - - //check the record is added into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(parentFolderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(nonElectronicFiled.getId()) && c.getFilePlanComponentModel().getParentId().equals(parentFolderId) - ) - ); - //check the record doesn't exist into unfiled record container - //TODO add a check after the issue will be fixed RM-4578 - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderToLink) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(nonElectronicFiled.getId()) //&& c.getFilePlanComponentModel().getParentId().equals(parentFolderId) - ) - ); - } - - /** - * Given an unfiled or filed record - * And a container that is NOT a record folder - * When I file the unfiled or filed record to the container - * Then I get an unsupported operation exception - */ + /** * Invalid containers where electronic and non-electronic records can be filed */ @@ -308,6 +109,207 @@ public class FileRecordsTests extends BaseRMRestTest { createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()).getId() } }; } + + /** + * Given an unfiled record in the root unfiled record container or a unfiled record folder + * And an open record folder + * When I file the unfiled record into the record folder + * Then the record is filed + */ + @Test + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers " + ) + public void fileRecordIntoExistingFolder(String unfiledContainerId) throws Exception + { + // get API instances + FilePlanComponentAPI filePlanComponentAPI = getRestAPIFactory().getFilePlanComponentsAPI(); + RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI(); + + // create a record folder + String folderId = createCategoryFolderInFilePlan().getId(); + + // create records + FilePlanComponent recordElectronic = filePlanComponentAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = filePlanComponentAPI.createFilePlanComponent(nonelectronicRecord, unfiledContainerId); + + // file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); + FilePlanComponent recordFiled = recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); + // check the response status + assertStatusCode(CREATED); + // check the parent id for the record returned + assertEquals(recordFiled.getParentId(),folderId); + + // check the record is filed into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c->c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // check the record doesn't exist into unfiled record container + assertFalse(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // file the non-electronic record into the folder created + FilePlanComponent nonElectRecordFiled = recordsAPI.fileRecord(recordBodyFile, recordNonElectId.getId()); + // check the response status code + assertStatusCode(CREATED); + // check the parent id for the record returned + assertEquals(nonElectRecordFiled.getParentId(), folderId); + + // check the record is added into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); + + // check the record doesn't exist into unfiled record container + assertFalse(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); + } + + /** + * Given an unfiled record in the root unfiled record container or a unfiled record folder + * And a closed record folder + * When I file the unfiled record into the record folder + * Then I get an unsupported operation exception + * + */ + @Test + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers into a closed folder " + ) + public void fileRecordIntoCloseFolder(String unfiledContainerId) throws Exception + { + // get API instances + FilePlanComponentAPI filePlanComponentAPI = getRestAPIFactory().getFilePlanComponentsAPI(); + RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI(); + + // create a record folder + String folderId = createCategoryFolderInFilePlan().getId(); + closeFolder(folderId); + // create records + FilePlanComponent recordElectronic = filePlanComponentAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = filePlanComponentAPI.createFilePlanComponent(nonelectronicRecord, unfiledContainerId); + + // file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(folderId).build(); + recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); + // check the response status + assertStatusCode(FORBIDDEN); + + // check the record is filed into the record folder + assertFalse(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // check the record doesn't exist into unfiled record container + assertTrue(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // file the non-electronic record into the folder created + recordsAPI.fileRecord(recordBodyFile, recordNonElectId.getId()); + // check the response status code + assertStatusCode(FORBIDDEN); + + // check the record is added into the record folder + assertFalse(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); + + // check the record doesn't exist into unfiled record container + assertTrue(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); + } + + /** + * Given a filed record in a record folder + * And an open record folder + * When I file the filed record into the record folder + * Then the record is filed in both locations + */ + @Test + @Bug(id="RM-4578") + public void linkRecordInto() throws Exception + { + // get API instances + FilePlanComponentAPI filePlanComponentAPI = getRestAPIFactory().getFilePlanComponentsAPI(); + RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI(); + + // create a record folder + String parentFolderId = createCategoryFolderInFilePlan().getId(); + + // create records + FilePlanComponent recordElectronic = filePlanComponentAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElect = filePlanComponentAPI.createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); + + // file the record into the folder created + RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(parentFolderId).build(); + FilePlanComponent recordFiled = recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); + FilePlanComponent nonElectronicFiled = recordsAPI.fileRecord(recordBodyFile, recordNonElect.getId()); + // check the response status + assertStatusCode(CREATED); + + // create the second folder + String folderToLink = createCategoryFolderInFilePlan().getId(); + recordBodyFile = RecordBodyFile.builder().targetParentId(folderToLink).build(); + + // check the response status + assertStatusCode(CREATED); + // link the electronic record + FilePlanComponent recordLink = recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); + assertTrue(recordLink.getParentId().equals(parentFolderId)); + // check the response status code + assertStatusCode(CREATED); + // link the nonelectronic record + FilePlanComponent nonElectronicLink = recordsAPI.fileRecord(recordBodyFile, nonElectronicFiled.getId()); + assertStatusCode(CREATED); + assertTrue(nonElectronicLink.getParentId().equals(parentFolderId)); + + // check the record is added into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(parentFolderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordFiled.getId()) && + c.getFilePlanComponentModel().getParentId().equals(parentFolderId))); + + // check the record doesn't exist into unfiled record container + // TODO add a check after the issue will be fixed RM-4578 + assertTrue(filePlanComponentAPI.listChildComponents(folderToLink) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordFiled.getId()))); + + // check the record is added into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(parentFolderId) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(nonElectronicFiled.getId()) && + c.getFilePlanComponentModel().getParentId().equals(parentFolderId))); + + // check the record doesn't exist into unfiled record container + // TODO add a check after the issue will be fixed RM-4578 + assertTrue(filePlanComponentAPI.listChildComponents(folderToLink) + .getEntries().stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(nonElectronicFiled.getId()))); + } + + /** + * Given an unfiled or filed record + * And a container that is NOT a record folder + * When I file the unfiled or filed record to the container + * Then I get an unsupported operation exception + */ @Test ( dataProvider = "invalidContainersForFile", @@ -315,18 +317,21 @@ public class FileRecordsTests extends BaseRMRestTest ) public void invalidContainerToFile(String containerId) throws Exception { + // get API instances + FilePlanComponentAPI filePlanComponentAPI = getRestAPIFactory().getFilePlanComponentsAPI(); + RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI(); + + // create records + FilePlanComponent recordElectronic = filePlanComponentAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); + FilePlanComponent recordNonElect = filePlanComponentAPI.createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); - //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), UNFILED_RECORDS_CONTAINER_ALIAS); - FilePlanComponent recordNonElect = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, UNFILED_RECORDS_CONTAINER_ALIAS); - - //file the record into the folder created + // file the record into the folder created RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(containerId).build(); - getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); assertStatusCode(BAD_REQUEST); - getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElect.getId()); - //check the response status + recordsAPI.fileRecord(recordBodyFile, recordNonElect.getId()); + // check the response status assertStatusCode(BAD_REQUEST); } @@ -336,64 +341,63 @@ public class FileRecordsTests extends BaseRMRestTest * Then the filePlan structure from relativePath is created and the record is filed into the specified path */ @Test - ( - dataProvider = "unfiledContainer", - description = "File record from unfiled containers " - ) + ( + dataProvider = "unfiledContainer", + description = "File record from unfiled containers " + ) public void fileRecordIntoRelativePath(String unfiledContainerId) throws Exception { - //create a record folder + // get API instances + FilePlanComponentAPI filePlanComponentAPI = getRestAPIFactory().getFilePlanComponentsAPI(); + RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI(); + + // create a record folder String RELATIVE_PATH = "CATEGORY" + getRandomAlphanumeric() + "/FOLDER"; - //create records - FilePlanComponent recordElectronic = getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); - FilePlanComponent recordNonElectId = getRestAPIFactory().getFilePlanComponentsAPI().createFilePlanComponent(nonelectronicRecord, unfiledContainerId); + // create records + FilePlanComponent recordElectronic = filePlanComponentAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), unfiledContainerId); + FilePlanComponent recordNonElectId = filePlanComponentAPI.createFilePlanComponent(nonelectronicRecord, unfiledContainerId); - //file the record into the folder created + // file the record into the folder created RecordBodyFile recordBodyFile = RecordBodyFile.builder().relativePath(RELATIVE_PATH).build(); - FilePlanComponent recordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordElectronic.getId()); + FilePlanComponent recordFiled = recordsAPI.fileRecord(recordBodyFile, recordElectronic.getId()); - //check the response status + // check the response status assertStatusCode(CREATED); - //Get the folder ID created - String folderId= getRestAPIFactory().getFilePlanComponentsAPI().getFilePlanComponent(FILE_PLAN_ALIAS, "relativePath="+RELATIVE_PATH).getId(); - //check the parent id for the record returned + // get the folder ID created + String folderId = filePlanComponentAPI.getFilePlanComponent(FILE_PLAN_ALIAS, "relativePath="+RELATIVE_PATH).getId(); + // check the parent id for the record returned assertEquals(recordFiled.getParentId(), folderId); - //check the record is filed into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordElectronic.getId()) - ) - ); - //file the non-electronic record into the folder created - FilePlanComponent nonElectRecordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, recordNonElectId.getId()); - //check the response status code + // check the record is filed into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // check the record doesn't exist into unfiled record container + assertFalse(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordElectronic.getId()))); + + // file the non-electronic record into the folder created + FilePlanComponent nonElectRecordFiled = recordsAPI.fileRecord(recordBodyFile, recordNonElectId.getId()); + // check the response status code assertStatusCode(CREATED); - //check the parent id for the record returned + // check the parent id for the record returned assertEquals(nonElectRecordFiled.getParentId(), folderId); - //check the record is added into the record folder - assertTrue(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(folderId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); - //check the record doesn't exist into unfiled record container - assertFalse(getRestAPIFactory().getFilePlanComponentsAPI().listChildComponents(unfiledContainerId) - .getEntries().stream() - .anyMatch(c -> c.getFilePlanComponentModel().getId() - .equals(recordNonElectId.getId()) - ) - ); + + // check the record is added into the record folder + assertTrue(filePlanComponentAPI.listChildComponents(folderId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); + + // check the record doesn't exist into unfiled record container + assertFalse(filePlanComponentAPI.listChildComponents(unfiledContainerId) + .getEntries() + .stream() + .anyMatch(c -> c.getFilePlanComponentModel().getId().equals(recordNonElectId.getId()))); } - } From e2670bc1b85607e2ca45d2a6013c56d63a38eec1 Mon Sep 17 00:00:00 2001 From: Kristijan Conkas Date: Thu, 5 Jan 2017 11:11:09 +0000 Subject: [PATCH 6/6] RM-4430: code readability tweak --- .../test/java/org/alfresco/rest/rm/community/base/TestData.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java index 167f79ae20..fae162b15f 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java @@ -123,10 +123,12 @@ public interface TestData * The default electronic record name used when creating electronic records */ public static String ELECTRONIC_RECORD_NAME = "Record electronic" + getRandomAlphanumeric(); + /** * The default Non electronic record name used when creating non-electronic records */ public static String NONELECTRONIC_RECORD_NAME = "Record nonelectronic" + getRandomAlphanumeric(); + /** * Data Provider with: * with the object types not allowed as children for a record category