Compare commits

...

19 Commits

Author SHA1 Message Date
ashiva
5fcb4fe18c "analyzing dispositionScheduleLinkedRecord " 2023-10-18 12:18:56 +05:30
ashiva
0a1ec09ecd "analyzing dispositionScheduleLinkedRecord " 2023-10-18 11:26:32 +05:30
ashiva
f01123d211 "made changes to SampleTest and DispositionScheduleLinkedRecordsTest " 2023-10-17 22:30:33 +05:30
ashiva
4051f58f2b "added SampleTest file " 2023-10-17 19:59:54 +05:30
ashiva
47c0ce5da5 "removed file " 2023-10-17 17:47:56 +05:30
ashiva
896ac31fad "added extra assertion " 2023-10-17 16:56:57 +05:30
ashiva
8047d028d8 "Added Sample test class" 2023-10-17 15:44:03 +05:30
ashiva
878aca1486 "Added Sample test class" 2023-10-17 15:40:18 +05:30
ashiva
6817341298 "Removed Sample test class" 2023-10-17 14:57:49 +05:30
ashiva
979e7eeb6c "Added sampledeleteLongestPeriodTestPrecondition" 2023-10-17 14:21:01 +05:30
ashiva
c74a0eaaa1 "Added sampledeleteLongestPeriodTestPrecondition" 2023-10-17 13:38:27 +05:30
ashiva
174815cbc6 "Added samplesameLevelDispositionScheduleStepsPeriodsCalculation" 2023-10-17 12:37:59 +05:30
ashiva
ec8bf4d29e "Property verification" 2023-10-17 12:00:15 +05:30
ashiva
107dc2f7c9 "Content verification done" 2023-10-17 10:31:27 +05:30
ashiva
ebf2e1e2e5 "uncommented code for edit disposition date and cut off" 2023-10-17 00:57:45 +05:30
ashiva
ab8e00cde8 "uncommented code for linkApi" 2023-10-17 00:00:59 +05:30
ashiva
f54db46ff2 "uncommented code" 2023-10-16 20:48:58 +05:30
ashiva
ad22fcc212 "created sample file for testing" 2023-10-16 19:43:01 +05:30
ashiva
4c45bace2e "enabled DispositionScheduleLinkedRecordsTest" 2023-10-16 16:08:58 +05:30

View File

@@ -53,6 +53,7 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.IOException;
@@ -135,66 +136,66 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
* <p>
* <p/> TestRail Test C775<p/>
**/
@Test(enabled = false) // temporary disabled, see ACS-6073
@Test // temporary disabled, see ACS-6073
@AlfrescoTest(jira = "RM-1622")
public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
STEP("Create record category");
RecordCategory category1 = createRootCategory(CATEGORY_RM_3077);
//create retention schedule
dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), false);
dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), true);
// add cut off step
dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE);
//create a copy of the category recordsCategory
String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077);
// create folders in both categories
RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077);
createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077);
// create record files
String electronicRecord = "RM-2801 electronic record";
Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord);
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord);
String nonElectronicRecord = "RM-2801 non-electronic record";
Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord);
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord);
// link the records to copy folder, then complete them
List<String> recordLists = new ArrayList<>();
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" +
COPY_FOLDER_RM_3077, recordLists);
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
// edit disposition date
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName());
// cut off the Folder
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName());
// Verify the Content
Node electronicNode = getNode(elRecord.getId());
assertTrue("The content of " + electronicRecord + " is available",
StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
// verify the Properties
AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
// // add cut off step
// dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE);
//
// //create a copy of the category recordsCategory
// String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077);
//
// // create folders in both categories
// RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077);
// createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077);
//
// // create record files
// String electronicRecord = "RM-2801 electronic record";
// Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord);
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord);
//
// String nonElectronicRecord = "RM-2801 non-electronic record";
// Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord);
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
// getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord);
// // link the records to copy folder, then complete them
// List<String> recordLists = new ArrayList<>();
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
//
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" +
// COPY_FOLDER_RM_3077, recordLists);
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
//
// // edit disposition date
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName());
//
// // cut off the Folder
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName());
//
// // Verify the Content
// Node electronicNode = getNode(elRecord.getId());
// assertTrue("The content of " + electronicRecord + " is available",
// StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
//
// // verify the Properties
// AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
//
// delete precondition
deleteRecordCategory(category1.getId());
deleteRecordCategory(copyCategoryId);
// deleteRecordCategory(copyCategoryId);
}
/**
@@ -377,7 +378,6 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
@Test
@AlfrescoTest(jira = "RM-1622")
public void sameLevelDispositionScheduleStepsPeriodsCalculation() throws Exception {
// create a category with retention applied on records level
RecordCategory catsameLevel1 = getRestAPIFactory().getFilePlansAPI(rmAdmin)
.createRootRecordCategory(RecordCategory.builder().name(