From c3f771125c567141b7eb44ce033f93414e74edf3 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Thu, 10 Sep 2020 10:37:02 +0300 Subject: [PATCH] tests to cover the ACs for APPS-424 --- .../community/model/record/RecordProperties.java | 2 +- .../requests/gscore/api/ActionsExecutionAPI.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java index 74104c3b9b..4b49f5f3bd 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/record/RecordProperties.java @@ -264,5 +264,5 @@ public class RecordProperties extends TestModel private String store; @JsonProperty(PROPERTIES_WORM_UNLOCK_DATE) - private String wormUnlockDate; + private Date wormUnlockDate; } diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java index 852c41a933..5433c4f605 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/ActionsExecutionAPI.java @@ -116,4 +116,19 @@ public class ActionsExecutionAPI extends RMModelRequest return getRmRestWrapper().withCoreAPI().usingActions() .executeAction(ActionsOnRule.WORM_LOCK.getActionValue(), targetNode); } + + /** + * WORM lock a node for a period of days + * * + * @param targetNode the node on which the action is executed + * @param retentionPeriod the retention period in days for the WORM lock + * @throws Exception + */ + @SneakyThrows + public JSONObject addWORMLock(RepoTestModel targetNode, int retentionPeriod) + { + return getRmRestWrapper().withCoreAPI().usingActions() + .executeAction(ActionsOnRule.WORM_LOCK.getActionValue(), targetNode, + ImmutableMap.of("retentionPeriod",String.valueOf(retentionPeriod))); + } }