diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java index fcb34ae859..b8f0bbe9a9 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java @@ -49,7 +49,6 @@ import static org.testng.Assert.assertTrue; import org.alfresco.rest.rm.community.base.BaseRMRestTest; import org.alfresco.rest.rm.community.model.record.Record; -import org.alfresco.rest.rm.community.model.record.RecordContent; import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild; import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChild; import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI; @@ -393,4 +392,33 @@ public class ElectronicRecordTests extends BaseRMRestTest assertTrue(unfiledRecordFoldersAPI.getUnfiledRecordFolder(record.getParentId()).getName().equals(unfiledRecordFolderPathEl4)); } + + /** + *
+ * Given a parent container that is a record folder + * When I try to create a record with name1 and create another one with the same given name + * Then the second record is created with success + *+ * + * @throws Exception + * if record can't be created + */ + @Test(description = "Electronic records can be created in record folder with duplicate name") + @Bug(id ="RM-5116, RM-5012") + public void canCreateElectronicRecordsWithDuplicateName() throws Exception + { + RecordCategoryChild recordFolder = createCategoryFolderInFilePlan(); + + // Create an electronic record with the name "Record 1" + Record recordModel = Record.builder().name("Record 1").nodeType(CONTENT_TYPE).build(); + getRestAPIFactory().getRecordFolderAPI().createRecord(recordModel, recordFolder.getId()); + // Verify the status code + assertStatusCode(CREATED); + + // Try to create another electronic record with the same name + getRestAPIFactory().getRecordFolderAPI().createRecord(recordModel, recordFolder.getId()); + + // Verify the status code + assertStatusCode(CREATED); + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/NonElectronicRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/NonElectronicRecordTests.java index 0c022e09b3..3794140bd2 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/NonElectronicRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/NonElectronicRecordTests.java @@ -33,9 +33,9 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo 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.rest.rm.community.util.PojoUtility.toJson; -import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createNonElectronicRecordModel; -import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createFullNonElectronicUnfiledContainerChildRecordModel; import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createFullNonElectronicRecordModel; +import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createFullNonElectronicUnfiledContainerChildRecordModel; +import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createNonElectronicRecordModel; import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.verifyFullNonElectronicRecord; import static org.alfresco.utility.constants.UserRole.SiteManager; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java index a6caf3b599..5f5193f283 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java @@ -136,12 +136,6 @@ public class FilePlanComponentsApiUtils RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER, RecordsManagementModel.TYPE_HOLD_CONTAINER); - public static final List