RM-6869 extracting actions utils to a class

This commit is contained in:
Ross Gale
2019-06-05 09:30:41 +01:00
parent e078e0f6d1
commit 77af43057a

View File

@@ -62,14 +62,14 @@ public class RejectRecordTests extends BaseRMRestTest
private RecordCategory recordCategory; private RecordCategory recordCategory;
private RecordCategoryChild recordFolder; private RecordCategoryChild recordFolder;
private ActionExecutorUtil actionExecuterUtil; private ActionExecutorUtil actionExecutorUtil;
private RecordCategoryChildCollection recordFolders; private RecordCategoryChildCollection recordFolders;
@BeforeClass (alwaysRun = true) @BeforeClass (alwaysRun = true)
public void setUp() throws Exception public void setUp() throws Exception
{ {
actionExecuterUtil = new ActionExecutorUtil(); actionExecutorUtil = new ActionExecutorUtil();
publicSite = dataSite.usingAdmin().createPublicRandomSite(); publicSite = dataSite.usingAdmin().createPublicRandomSite();
recordCategory = createRootCategory(getRandomName("recordCategory")); recordCategory = createRootCategory(getRandomName("recordCategory"));
recordFolder = createFolder(recordCategory.getId(), getRandomName("recordFolder")); recordFolder = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
@@ -95,7 +95,7 @@ public class RejectRecordTests extends BaseRMRestTest
STEP("Link record to new folder"); STEP("Link record to new folder");
getRestAPIFactory().getActionsAPI().linkRecord(testFile, recordCategory.getName() + "/" + recordFolder.getName() + "_2"); getRestAPIFactory().getActionsAPI().linkRecord(testFile, recordCategory.getName() + "/" + recordFolder.getName() + "_2");
recordFolders = null; recordFolders = null;
actionExecuterUtil.checkActionExecution(new LinkEvaluator()); actionExecutorUtil.checkActionExecution(new LinkEvaluator());
Optional<RecordCategoryChildEntry> linkedFolder = recordFolders.getEntries().stream().filter(child -> child.getEntry().getName().equals(recordFolder.getName() + "_2")) Optional<RecordCategoryChildEntry> linkedFolder = recordFolders.getEntries().stream().filter(child -> child.getEntry().getName().equals(recordFolder.getName() + "_2"))
.findFirst(); .findFirst();
@@ -106,7 +106,7 @@ public class RejectRecordTests extends BaseRMRestTest
STEP("Reject record"); STEP("Reject record");
getRestAPIFactory().getActionsAPI().rejectRecord(testFile, "Just because"); getRestAPIFactory().getActionsAPI().rejectRecord(testFile, "Just because");
actionExecuterUtil.checkActionExecution(new RejectEvaluator()); actionExecutorUtil.checkActionExecution(new RejectEvaluator());
STEP("Check record has been rejected"); STEP("Check record has been rejected");
assertFalse("Record rejection failure", isMatchingRecordInRecordFolder(testFile, recordFolder)); assertFalse("Record rejection failure", isMatchingRecordInRecordFolder(testFile, recordFolder));