RM-6865 adding param to test

This commit is contained in:
Ross Gale
2019-06-18 08:57:46 +01:00
parent a736112f0d
commit 3819bbac88
2 changed files with 16 additions and 1 deletions

View File

@@ -64,6 +64,21 @@ public class ActionsExecutionAPI extends RMModelRequest
ImmutableMap.of("path", destinationPath)); ImmutableMap.of("path", destinationPath));
} }
/**
* Declares and files a document as record to a record folder using v1 actions api
*
* @param targetNode the node on which the action is executed
* @param destinationPath the path to the record folder
* @param encoded value to indicate if the path has been encoded
* @throws Exception
*/
public JSONObject declareAndFile(RepoTestModel targetNode, String destinationPath, boolean encoded) throws Exception
{
return getRmRestWrapper().withCoreAPI().usingActions()
.executeAction(ActionsOnRule.DECLARE_AS_RECORD.getActionValue(), targetNode,
ImmutableMap.of("path", destinationPath, "encoded", String.valueOf(encoded)));
}
/** /**
* Declares a document as record using v1 actions api * Declares a document as record using v1 actions api
* *

View File

@@ -237,7 +237,7 @@ public class DeclareAndFileDocumentAsRecordTests extends BaseRMRestTest
{ {
STEP("Declare document as record with an encoded location parameter value"); STEP("Declare document as record with an encoded location parameter value");
getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFile(testFile, getRestAPIFactory().getActionsAPI(userFillingPermission).declareAndFile(testFile,
Utility.buildPath(recordCategory.getName(), RECORD_FOLDER_NAME_ENCODED)); Utility.buildPath(recordCategory.getName(), RECORD_FOLDER_NAME_ENCODED), true);
STEP("Verify the declared record is placed in the record folder"); STEP("Verify the declared record is placed in the record folder");
assertTrue(isMatchingRecordInRecordFolder(testFile, recordFolderWithSpacesInName), "Record should be filed to record folder"); assertTrue(isMatchingRecordInRecordFolder(testFile, recordFolderWithSpacesInName), "Record should be filed to record folder");