diff --git a/e2e-test/java/org/alfresco/rest/actions/ActionsTests.java b/e2e-test/java/org/alfresco/rest/actions/ActionsTests.java index f85d9d8ae..78ed3b53e 100644 --- a/e2e-test/java/org/alfresco/rest/actions/ActionsTests.java +++ b/e2e-test/java/org/alfresco/rest/actions/ActionsTests.java @@ -1,11 +1,9 @@ package org.alfresco.rest.actions; -import static junit.framework.Assert.fail; import static org.testng.Assert.assertFalse; import org.alfresco.dataprep.CMISUtil; import org.alfresco.rest.RestTest; -import org.alfresco.rest.exception.EmptyJsonResponseException; import org.alfresco.rest.model.RestActionDefinitionModel; import org.alfresco.rest.model.RestActionDefinitionModelsCollection; import org.alfresco.rest.model.RestNodeModel; @@ -105,6 +103,30 @@ public class ActionsTests extends RestTest }); } + @TestRail (section = { TestGroup.REST_API, TestGroup.ACTIONS }, executionType = ExecutionType.SANITY, + description = "Sanity test for POST /action-executions") + @Test (groups = { TestGroup.REST_API, TestGroup.ACTIONS, TestGroup.SANITY }) + public void executeActionWithoutParam() throws Exception + { + JSONObject response = restClient.authenticateUser(adminUser).withCoreAPI().usingActions().executeAction + ("check-out", document); + restClient.assertStatusCodeIs(HttpStatus.ACCEPTED); + + assertFalse(response.getString("id").isEmpty()); + + /* + * Get all node properties and check that action was executed and + * cm:checkedOut aspect was added + */ + Utility.sleep(500, 20000, () -> { + RestNodeModel fileModel = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(document) + .getNode(); + + restClient.assertStatusCodeIs(HttpStatus.OK); + fileModel.assertThat().field("aspectNames").contains("cm:checkedOut"); + }); + } + @TestRail(section = { TestGroup.REST_API,TestGroup.ACTIONS }, executionType = ExecutionType.SANITY, description = "Sanity test for ACTIONS endpoint GET action-definitions/{actionDefinitionId}") @Test(groups = { TestGroup.REST_API, TestGroup.ACTIONS, TestGroup.SANITY})