mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge 'master' into feature/RM-5012_recordIdentifier
This commit is contained in:
@@ -28,6 +28,7 @@ package org.alfresco.rest.rm.community.base;
|
||||
|
||||
import static lombok.AccessLevel.PROTECTED;
|
||||
|
||||
import static org.alfresco.rest.rm.community.base.TestData.ELECTRONIC_RECORD_NAME;
|
||||
import static org.alfresco.rest.rm.community.base.TestData.RECORD_CATEGORY_TITLE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||
@@ -35,10 +36,11 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
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.RECORD_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_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.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryChildModel;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryModel;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createTempFile;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createUnfiledContainerChildModel;
|
||||
import static org.alfresco.rest.rm.community.utils.RMSiteUtil.createStandardRMSiteModel;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||
@@ -52,6 +54,7 @@ import java.util.List;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestAPIFactory;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
|
||||
import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType;
|
||||
import org.alfresco.rest.rm.community.model.record.Record;
|
||||
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
|
||||
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
|
||||
@@ -334,8 +337,17 @@ public class BaseRMRestTest extends RestTest
|
||||
*/
|
||||
public UnfiledContainerChild createUnfiledContainerChild(UserModel user, String parentId, String childName, String nodeType) throws Exception
|
||||
{
|
||||
UnfiledContainerChild child = null;
|
||||
UnfiledContainerChild childModel = createUnfiledContainerChildModel(childName, nodeType);
|
||||
UnfiledContainerChild child = getRestAPIFactory().getUnfiledContainersAPI(user).createUnfiledContainerChild(childModel, parentId);
|
||||
|
||||
if (FilePlanComponentType.CONTENT_TYPE.equals(nodeType))
|
||||
{
|
||||
child = getRestAPIFactory().getUnfiledContainersAPI(user).uploadRecord(childModel, parentId, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME));
|
||||
}
|
||||
else
|
||||
{
|
||||
child = getRestAPIFactory().getUnfiledContainersAPI(user).createUnfiledContainerChild(childModel, parentId);
|
||||
}
|
||||
assertStatusCode(CREATED);
|
||||
|
||||
return child;
|
||||
|
@@ -159,6 +159,22 @@ public interface TestData
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Provider with:
|
||||
* with the object types for creating a Record Category Child
|
||||
*
|
||||
* @return record category child type
|
||||
*/
|
||||
@DataProvider
|
||||
public static Object[][] categoryChild()
|
||||
{
|
||||
return new String[][] {
|
||||
{ RECORD_FOLDER_TYPE },
|
||||
{ FOLDER_TYPE },
|
||||
{ RECORD_CATEGORY_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalid root level types, at unfiled record folder/unfiled containers container level that shouldn't be possible to create
|
||||
*/
|
||||
@@ -171,7 +187,9 @@ public interface TestData
|
||||
{ RECORD_CATEGORY_TYPE },
|
||||
{ RECORD_FOLDER_TYPE },
|
||||
{ TRANSFER_CONTAINER_TYPE },
|
||||
{ UNFILED_CONTAINER_TYPE }
|
||||
{ TRANSFER_TYPE },
|
||||
{ UNFILED_CONTAINER_TYPE },
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -45,12 +45,14 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING;
|
||||
import static org.alfresco.rest.rm.community.model.user.UserRoles.ROLE_RM_MANAGER;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||
import static org.springframework.http.HttpStatus.CONFLICT;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
import static org.springframework.http.HttpStatus.FORBIDDEN;
|
||||
import static org.springframework.http.HttpStatus.NOT_FOUND;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
import static org.testng.Assert.fail;
|
||||
@@ -322,6 +324,56 @@ public class FilePlanTests extends BaseRMRestTest
|
||||
assertNotNull(rootRecordCategoryProperties.getIdentifier());
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Given a root category
|
||||
* When I ask the API to create a root category having the same name
|
||||
* Then the response code received is 409 - name clashes with an existing node
|
||||
*</pre>
|
||||
* <pre>
|
||||
* Given a root category
|
||||
* When I ask the API to create a root category having the same name with autoRename parameter on true
|
||||
* Then the record category is created the record category has a unique name by adding an integer suffix
|
||||
* </pre>
|
||||
*/
|
||||
@Test
|
||||
@Bug(id = "RM-5116")
|
||||
public void createDuplicateCategories() throws Exception
|
||||
{
|
||||
String categoryName = "Category name " + getRandomAlphanumeric();
|
||||
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
||||
|
||||
|
||||
// Create the root record category
|
||||
RecordCategory recordCategory = RecordCategory.builder()
|
||||
.name(categoryName)
|
||||
.properties(RecordCategoryProperties.builder()
|
||||
.title(categoryTitle)
|
||||
.build())
|
||||
.build();
|
||||
// Create the root record category
|
||||
RecordCategory rootRecordCategory = getRestAPIFactory().getFilePlansAPI().createRootRecordCategory(recordCategory,FILE_PLAN_ALIAS);
|
||||
|
||||
// Verify the status code
|
||||
assertStatusCode(CREATED);
|
||||
assertEquals(rootRecordCategory.getName(), categoryName);
|
||||
|
||||
// Create the same root record category
|
||||
getRestAPIFactory().getFilePlansAPI().createRootRecordCategory(recordCategory, FILE_PLAN_ALIAS);
|
||||
|
||||
// Verify the status code
|
||||
assertStatusCode(CONFLICT);
|
||||
|
||||
//create the same category with autoRename parameter on true
|
||||
RecordCategory rootRecordCategoryAutoRename = getRestAPIFactory().getFilePlansAPI()
|
||||
.createRootRecordCategory(recordCategory, FILE_PLAN_ALIAS,"autoRename=true");
|
||||
|
||||
// Verify the status code
|
||||
assertStatusCode(CREATED);
|
||||
assertNotEquals(rootRecordCategoryAutoRename.getName(), categoryName);
|
||||
assertTrue(rootRecordCategoryAutoRename.getName().startsWith(categoryName));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listFilePlanChildren() throws Exception
|
||||
{
|
||||
|
@@ -38,8 +38,10 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
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.utils.FilePlanComponentsUtil.TITLE_PREFIX;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryChildModel;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
import static org.springframework.http.HttpStatus.CONFLICT;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
import static org.springframework.http.HttpStatus.NOT_FOUND;
|
||||
import static org.springframework.http.HttpStatus.NO_CONTENT;
|
||||
@@ -47,11 +49,13 @@ 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.assertNotEquals;
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@@ -66,7 +70,10 @@ import org.alfresco.rest.rm.community.model.recordfolder.RecordFolder;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.RecordCategoryAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI;
|
||||
import org.alfresco.rest.v0.RecordCategoriesAPI;
|
||||
import org.alfresco.rest.core.v0.BaseAPI.RETENTION_SCHEDULE;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -83,6 +90,9 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
private static final int NUMBER_OF_CHILDREN = 10;
|
||||
private static final int NUMBER_OF_FOLDERS = 5;
|
||||
|
||||
@Autowired
|
||||
private RecordCategoriesAPI recordCategoriesAPI;
|
||||
|
||||
/**
|
||||
* Invalid containers that cannot be deleted with record category end-point
|
||||
*/
|
||||
@@ -287,6 +297,43 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
assertEquals(folderProperties.getTitle(), TITLE_PREFIX + RECORD_FOLDER_NAME);
|
||||
assertNotNull(folderProperties.getIdentifier());
|
||||
}
|
||||
@Test
|
||||
(
|
||||
dataProviderClass = TestData.class,
|
||||
dataProvider = "categoryChild"
|
||||
)
|
||||
@Bug(id = "RM-5116")
|
||||
public void createdDuplicateChild(String childType)throws Exception
|
||||
{
|
||||
// create a root category
|
||||
String rootRecordCategory = createRootCategory(RECORD_CATEGORY_NAME + getRandomAlphanumeric()).getId();
|
||||
|
||||
// Create the record category child
|
||||
RecordCategoryChild recordFolder = createRecordCategoryChild(rootRecordCategory, RECORD_FOLDER_NAME, childType);
|
||||
|
||||
// check the response code
|
||||
assertStatusCode(CREATED);
|
||||
assertEquals(recordFolder.getName(), RECORD_FOLDER_NAME);
|
||||
|
||||
// Create a record category child with the same name as the exiting one
|
||||
|
||||
RecordCategoryChild recordFolderDuplicate = getRestAPIFactory().getRecordCategoryAPI().createRecordCategoryChild(
|
||||
createRecordCategoryChildModel(RECORD_FOLDER_NAME, childType), rootRecordCategory);
|
||||
|
||||
// check the response code
|
||||
assertStatusCode(CONFLICT);
|
||||
|
||||
// Create a record folder with the same name as the exiting one and with the autoRename parameter on true
|
||||
recordFolderDuplicate = getRestAPIFactory().getRecordCategoryAPI()
|
||||
.createRecordCategoryChild(createRecordCategoryChildModel(RECORD_FOLDER_NAME,
|
||||
childType),
|
||||
rootRecordCategory, "autoRename=true");
|
||||
// check the response code
|
||||
assertStatusCode(CREATED);
|
||||
assertNotEquals(recordFolderDuplicate.getName(), RECORD_FOLDER_NAME);
|
||||
assertTrue(recordFolderDuplicate.getName().contains(RECORD_FOLDER_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Given that a record category exists
|
||||
@@ -294,17 +341,37 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
* When I ask the API to get me the children of the record category
|
||||
* Then I am returned the contained record categories and record folders and their details
|
||||
* </pre>
|
||||
* <pre>
|
||||
* Given that a record category with a disposition schedule exists
|
||||
* And contains a number of record categories and record folders
|
||||
* When I ask the API to get me the children of the record category
|
||||
* Then I am returned the contained record categories and record folders but not the disposition schedule
|
||||
* </pre>
|
||||
*/
|
||||
@Test
|
||||
(
|
||||
description = "Get children of a record category"
|
||||
)
|
||||
(
|
||||
description = "Get children of a record category excluding the disposition schedule"
|
||||
)
|
||||
@Bug (id="RM-5115")
|
||||
public void getRecordCategoryChildren() throws Exception
|
||||
{
|
||||
// Create root level category
|
||||
RecordCategory rootRecordCategory = createRootCategory(getRandomAlphanumeric());
|
||||
assertNotNull(rootRecordCategory.getId());
|
||||
|
||||
// Create disposition schedule
|
||||
String userName = getAdminUser().getUsername();
|
||||
String userPassword = getAdminUser().getPassword();
|
||||
String categoryName = rootRecordCategory.getName();
|
||||
recordCategoriesAPI.createRetentionSchedule(userName, userPassword, categoryName);
|
||||
|
||||
// Add disposition schedule cut off step
|
||||
HashMap<RETENTION_SCHEDULE, String> cutOffStep = new HashMap<>();
|
||||
cutOffStep.put(RETENTION_SCHEDULE.NAME, "cutoff");
|
||||
cutOffStep.put(RETENTION_SCHEDULE.RETENTION_PERIOD, "day|2");
|
||||
cutOffStep.put(RETENTION_SCHEDULE.DESCRIPTION, "Cut off after 2 days");
|
||||
recordCategoriesAPI.addDispositionScheduleSteps(userName, userPassword, categoryName, cutOffStep);
|
||||
|
||||
// Add record category children
|
||||
List<RecordCategoryChild> children = new ArrayList<RecordCategoryChild>();
|
||||
for (int i=0; i < NUMBER_OF_CHILDREN; i++)
|
||||
|
@@ -34,6 +34,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.IS_CLOSED;
|
||||
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.NON_ELECTRONIC_RECORD_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;
|
||||
@@ -105,7 +106,8 @@ public class RecordFolderTests extends BaseRMRestTest
|
||||
{ UNFILED_CONTAINER_TYPE },
|
||||
{ UNFILED_RECORD_FOLDER_TYPE },
|
||||
{ TRANSFER_TYPE },
|
||||
{ RECORD_CATEGORY_TYPE }
|
||||
{ RECORD_CATEGORY_TYPE },
|
||||
{ FOLDER_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -370,9 +372,6 @@ public class RecordFolderTests extends BaseRMRestTest
|
||||
// Make a request to close the record folder
|
||||
RecordFolder updatedRecordFolder = recordFolderAPI.updateRecordFolder(recordFolderModel, recordFolder.getId());
|
||||
|
||||
//FIXME - remove this workaround after RM-4921 is fixed.
|
||||
updatedRecordFolder = recordFolderAPI.getRecordFolder(updatedRecordFolder.getId());
|
||||
|
||||
// Verify that the record folder is closed now
|
||||
assertTrue(updatedRecordFolder.getProperties().getIsClosed());
|
||||
|
||||
@@ -386,9 +385,6 @@ public class RecordFolderTests extends BaseRMRestTest
|
||||
// Make a request to reopen the record folder
|
||||
updatedRecordFolder = recordFolderAPI.updateRecordFolder(recordFolderModel, recordFolder.getId());
|
||||
|
||||
//FIXME - remove this workaround after RM-4921 is fixed.
|
||||
updatedRecordFolder = recordFolderAPI.getRecordFolder(updatedRecordFolder.getId());
|
||||
|
||||
// Verify that the record folder is open now
|
||||
assertFalse(updatedRecordFolder.getProperties().getIsClosed());
|
||||
}
|
||||
|
@@ -38,10 +38,13 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createUnfiledContainerChildModel;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
import static org.springframework.http.HttpStatus.CONFLICT;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
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.assertNotEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
@@ -61,6 +64,7 @@ import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledRecordFolder
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.UnfiledContainerAPI;
|
||||
import org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.DataProvider;
|
||||
@@ -165,7 +169,7 @@ public class UnfiledContainerTests extends BaseRMRestTest
|
||||
public void createUnfiledRecordFolderChild(String folderType) throws Exception
|
||||
{
|
||||
String unfiledRecordFolderName = "UnfiledRecordFolder-" + getRandomAlphanumeric();
|
||||
UnfiledContainerChild unfiledRecordFolderChild = createUnfiledContainerChild(UNFILED_RECORDS_CONTAINER_ALIAS, unfiledRecordFolderName, UNFILED_RECORD_FOLDER_TYPE);
|
||||
UnfiledContainerChild unfiledRecordFolderChild = createUnfiledContainerChild(UNFILED_RECORDS_CONTAINER_ALIAS, unfiledRecordFolderName, folderType);
|
||||
|
||||
assertNotNull(unfiledRecordFolderChild.getId());
|
||||
|
||||
@@ -186,7 +190,40 @@ public class UnfiledContainerTests extends BaseRMRestTest
|
||||
assertEquals(unfiledRecordFolder.getParentId(),
|
||||
getRestAPIFactory().getUnfiledContainersAPI().getUnfiledContainer(UNFILED_RECORDS_CONTAINER_ALIAS).getId());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
( description = "Create duplicate unfiled folder child",
|
||||
dataProvider = "unfiledFolderTypes"
|
||||
)
|
||||
@Bug(id ="RM-5116, RM-5148")
|
||||
public void createDuplicateUnfiledFolderChild(String folderType) throws Exception
|
||||
{
|
||||
String unfiledRecordFolderName = "UnfiledRecordFolder-" + getRandomAlphanumeric();
|
||||
UnfiledContainerChild unfiledRecordFolderChild = createUnfiledContainerChild(UNFILED_RECORDS_CONTAINER_ALIAS,
|
||||
unfiledRecordFolderName, folderType);
|
||||
|
||||
// Verify the status code
|
||||
assertStatusCode(CREATED);
|
||||
assertEquals(unfiledRecordFolderChild.getName(), unfiledRecordFolderName);
|
||||
|
||||
// create the same unfiled folder
|
||||
UnfiledContainerChild unfiledRecordFolderDuplicate = getRestAPIFactory().getUnfiledContainersAPI()
|
||||
.createUnfiledContainerChild(createUnfiledContainerChildModel(unfiledRecordFolderName, folderType),
|
||||
UNFILED_RECORDS_CONTAINER_ALIAS);
|
||||
|
||||
// Verify the status code
|
||||
assertStatusCode(CONFLICT);
|
||||
|
||||
// create the same unfiled folder with the autoRename parameter on true
|
||||
unfiledRecordFolderDuplicate = getRestAPIFactory().getUnfiledContainersAPI()
|
||||
.createUnfiledContainerChild(createUnfiledContainerChildModel(unfiledRecordFolderName, folderType),UNFILED_RECORDS_CONTAINER_ALIAS,"autoRename=true");
|
||||
|
||||
//verify the response status code
|
||||
assertStatusCode(CREATED);
|
||||
assertNotEquals(unfiledRecordFolderDuplicate.getName(), unfiledRecordFolderName);
|
||||
assertTrue(unfiledRecordFolderDuplicate.getName().startsWith(unfiledRecordFolderName));
|
||||
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Given that an unfiled records container exists
|
||||
@@ -396,7 +433,8 @@ public class UnfiledContainerTests extends BaseRMRestTest
|
||||
try
|
||||
{
|
||||
getRestAPIFactory().getUnfiledContainersAPI().createUnfiledContainerChild(unfiledFolderModel, UNFILED_RECORDS_CONTAINER_ALIAS);
|
||||
} catch (Exception error)
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
}
|
||||
// Verify the status code
|
||||
|
@@ -487,8 +487,10 @@ public class UnfiledRecordsFolderTests extends BaseRMRestTest
|
||||
assertTrue(record.getName().equals(createdComponent.getName()),
|
||||
"The record name "+ record.getName()+" is not equal with the record name returned when creating the record " + createdComponent
|
||||
.getName());
|
||||
|
||||
assertTrue(record.getName().contains(record.getProperties().getIdentifier()));
|
||||
String identifier = " \\(" + record.getProperties().getIdentifier() + "\\)";
|
||||
String regex= "(" + NONELECTRONIC_RECORD_NAME + "|" + ELECTRONIC_RECORD_NAME + ")" + "[0-9]+" + identifier;
|
||||
assertTrue(record.getName().matches(regex),
|
||||
"The record name:" + record.getName() + " doesn't match the expression " + regex);
|
||||
assertTrue(createdComponent.getName().contains(createdComponent.getProperties().getIdentifier()));
|
||||
assertEquals(createdComponent.getNodeType(), record.getNodeType());
|
||||
|
||||
|
Reference in New Issue
Block a user